From 0f41eba57f59b18b2e8c219e02436adc990b6680 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 08:44:29 -0300 Subject: [PATCH 01/72] some changes --- android/app/src/main/AndroidManifest.xml | 2 +- lib/app_state.dart | 2 +- lib/backend/schema/structs/index.dart | 3 - lib/{ => commons}/actions/actions.dart | 163 ++- .../actions}/api_calls.dart | 2 +- .../actions}/api_manager.dart | 2 +- .../actions/convert_image_file_to_base64.dart | 15 +- .../actions/convert_to_upload_file.dart | 12 +- .../actions/get_dev_u_u_i_d.dart | 12 +- .../actions}/get_streamed_response.dart | 0 .../actions/index.dart | 3 + .../nav => commons/actions}/nav.dart | 33 +- .../actions}/pushNotificationService.dart | 175 +-- .../actions}/serialization_util.dart | 10 +- .../actions}/tapNotifcationActivity.dart | 2 +- lib/commons/components/atoms/index.dart | 0 .../components/atoms/local_header/index.dart | 0 .../components/atoms/local_header/model.dart} | 5 +- .../atoms/local_header/widget.dart} | 17 +- .../atoms/menu_button_item/index.dart | 0 .../atoms/menu_button_item/widget.dart | 147 ++ .../atoms/menu_card_item/index.dart | 0 .../atoms/menu_card_item/widget.dart | 109 ++ lib/commons/components/index.dart | 0 .../components/molecules/card/index.dart | 0 .../components/molecules/card/model.dart} | 6 +- .../components/molecules/card/widget.dart} | 78 +- .../components/molecules/header/index.dart | 0 lib/commons/components/molecules/index.dart | 0 .../components/molecules/menu_item/index.dart | 0 .../molecules/menu_item/widget.dart | 11 + .../molecules/menu_list_view/index.dart | 0 .../molecules/menu_list_view/model.dart} | 6 +- .../molecules/menu_list_view/widget.dart | 172 +++ .../molecules/menu_staggered_view/index.dart | 0 .../molecules/menu_staggered_view/model.dart} | 8 +- .../menu_staggered_view/widget.dart} | 10 +- .../molecules/message_well/index.dart | 0 .../molecules/message_well/model.dart} | 9 +- .../molecules/message_well/widget.dart} | 8 +- .../components/molecules/well/index.dart | 0 lib/commons/components/organisms/index.dart | 0 .../components/organisms/menu/index.dart | 0 .../components/organisms/menu/model.dart} | 39 +- .../components/organisms/menu/widget.dart | 217 +++ .../components/templates/browser/index.dart | 0 .../components/templates/consult/index.dart | 0 .../components/templates/consult/model.dart | 0 .../components/templates/consult/widget.dart | 0 .../components/templates/detail/index.dart | 0 .../components/templates/exception/index.dart | 0 .../templates/exception/model.dart} | 4 +- .../templates/exception/widget.dart} | 10 +- .../components/templates/filter/index.dart | 0 .../components/templates/forms/index.dart | 0 lib/commons/components/templates/index.dart | 0 .../templates/notification/index.dart | 0 .../components/templates/register/index.dart | 0 .../components/templates/register/mode.dart | 0 .../components/templates/register/widget.dart | 0 .../components/templates/schedule/index.dart | 0 .../components/templates/schedule/model.dart | 0 .../components/templates/schedule/widget.dart | 0 .../components/templates/setting/index.dart | 0 .../components/templates/setting/model.dart | 0 .../components/templates/setting/widget.dart | 0 .../components/templates/welcome/index.dart | 0 .../components/templates/welcome/model.dart | 0 .../components/templates/welcome/widget.dart | 0 .../schema/enums/enums.dart | 11 + lib/commons/schema/enums/index.dart | 0 lib/commons/schema/index.dart | 0 .../schema/structs/device_struct.dart | 4 +- lib/commons/schema/structs/index.dart | 3 + lib/commons/schema/util/index.dart | 0 .../schema/util/schema_util.dart | 4 +- lib/commons/widgets/a11y/index.dart | 0 lib/commons/widgets/control/index.dart | 0 .../widgets}/custom_functions.dart | 4 +- .../widgets}/custom_icons.dart | 0 .../widgets}/flutter_flow_animations.dart | 0 .../widgets}/flutter_flow_button_tabbar.dart | 0 .../widgets}/flutter_flow_checkbox_group.dart | 0 .../widgets}/flutter_flow_drop_down.dart | 0 .../widgets}/flutter_flow_icon_button.dart | 0 .../widgets}/flutter_flow_model.dart | 0 .../widgets}/flutter_flow_theme.dart | 0 .../widgets}/flutter_flow_util.dart | 6 +- .../widgets}/flutter_flow_widgets.dart | 0 .../widgets}/form_field_controller.dart | 0 lib/commons/widgets/image_cropper.dart | 179 +++ .../widgets/index.dart | 0 lib/commons/widgets/info/index.dart | 0 .../widgets}/internationalization.dart | 0 lib/commons/widgets/io/index.dart | 0 lib/commons/widgets/io/textfield/index.dart | 0 .../widgets/io/textfield/model.dart} | 4 +- .../widgets/io/textfield/widget.dart} | 8 +- .../widgets}/keep_alive_wrapper.dart | 0 .../widgets}/lat_lng.dart | 0 lib/commons/widgets/layout/index.dart | 0 lib/commons/widgets/menu.dart | 61 + lib/commons/widgets/nav/index.dart | 0 .../widgets}/permissions_util.dart | 0 .../widgets}/place.dart | 0 .../widgets}/random_data_util.dart | 0 .../widgets}/request_manager.dart | 0 lib/commons/widgets/scroll/index.dart | 0 lib/commons/widgets/style/index.dart | 0 .../widgets}/upload_data.dart | 0 .../widgets}/uploaded_file.dart | 0 lib/commons/widgets/view/index.dart | 0 .../menu_component/menu_component_widget.dart | 135 -- .../menu_list_view_component_widget.dart | 1027 -------------- ...siter_vistor_template_component_model.dart | 57 - .../sign_in_template_component_model.dart | 59 - .../sign_up_template_component_model.dart | 91 -- .../welcome_template_component_model.dart | 13 - lib/custom_code/widgets/image_cropper.dart | 179 --- lib/index.dart | 43 +- lib/main.dart | 6 +- lib/modals/browsers/index.dart | 0 .../browsers/visitor_browser/index.dart | 0 .../browsers/visitor_browser/model.dart} | 7 +- .../browsers/visitor_browser/widget.dart} | 20 +- lib/modals/details/index.dart | 0 .../index.dart | 0 .../model.dart} | 8 +- .../widget.dart} | 8 +- .../details/schedule_visit_detail/index.dart | 0 .../details/schedule_visit_detail/model.dart} | 7 +- .../schedule_visit_detail/widget.dart} | 19 +- .../details/view_visit_detail/index.dart | 0 .../details/view_visit_detail/model.dart} | 7 +- .../details/view_visit_detail/widget.dart} | 20 +- .../details/visit_details_modal/index.dart | 0 .../details/visit_details_modal/model.dart} | 11 +- .../details/visit_details_modal/widget.dart} | 13 +- .../details/visitor_details_modal/index.dart | 0 .../details/visitor_details_modal/model.dart} | 4 +- .../visitor_details_modal/widget.dart} | 8 +- lib/modals/exceptions/error/index.dart | 0 lib/modals/exceptions/index.dart | 0 lib/modals/exceptions/info/index.dart | 0 lib/modals/exceptions/not_found/index.dart | 0 .../exceptions/not_found/model.dart} | 4 +- .../exceptions/not_found/widget.dart} | 16 +- lib/modals/exceptions/warning/index.dart | 0 lib/modals/filters/access_filter/index.dart | 0 .../filters/access_filter/model.dart} | 6 +- .../filters/access_filter/widget.dart} | 7 +- lib/modals/filters/options/index.dart | 0 .../filters/options/model.dart} | 6 +- .../filters/options/widget.dart} | 7 +- lib/modals/filters/selections/index.dart | 0 .../filters/selections/model.dart} | 4 +- .../filters/selections/widget.dart} | 13 +- lib/modals/forms/change_password/index.dart | 0 .../forms/change_password/model.dart} | 4 +- .../forms/change_password/widget.dart} | 12 +- lib/modals/forms/forgot_password/index.dart | 0 .../forms/forgot_password/model.dart} | 8 +- .../forms/forgot_password/widget.dart} | 14 +- lib/modals/forms/index.dart | 0 lib/modals/forms/qr_code/index.dart | 0 .../forms/qr_code/model.dart} | 4 +- .../forms/qr_code/widget.dart} | 16 +- lib/modals/index.dart | 0 .../access_notification/index.dart | 0 .../access_notification/model.dart} | 8 +- .../access_notification/widget.dart} | 8 +- lib/modals/notifications/index.dart | 0 .../message_notificaion/index.dart | 0 .../message_notificaion/model.dart} | 8 +- .../message_notificaion/widget.dart} | 6 +- .../notifications/visit_request/index.dart | 0 .../notifications/visit_request/model.dart} | 5 +- .../notifications/visit_request/widget.dart} | 11 +- .../bottom_arrow_linked_locals/index.dart | 0 .../bottom_arrow_linked_locals/model.dart} | 4 +- .../bottom_arrow_linked_locals/widget.dart} | 12 +- lib/modals/selection/index.dart | 0 .../top_arrow_linked_locals/index.dart | 0 .../top_arrow_linked_locals/model.dart} | 4 +- .../top_arrow_linked_locals/widget.dart} | 6 +- .../up_arrow_linked_locals/index.dart | 0 .../up_arrow_linked_locals/model.dart} | 4 +- .../up_arrow_linked_locals/widget.dart} | 12 +- lib/pages/consults/access/index.dart | 0 .../access/model.dart} | 12 +- .../access/widget.dart} | 49 +- lib/pages/consults/index.dart | 0 lib/pages/consults/liberation/index.dart | 0 .../liberation/model.dart} | 9 +- .../liberation/widget.dart} | 28 +- lib/pages/consults/message/index.dart | 0 .../message/model.dart} | 13 +- lib/pages/consults/message/widget.dart | 288 ++++ lib/pages/consults/poeple/index.dart | 0 .../poeple/model.dart} | 4 +- .../poeple/widget.dart} | 14 +- lib/pages/consults/qrcode/index.dart | 0 .../qrcode/model.dart} | 4 +- .../qrcode/widget.dart} | 82 +- lib/pages/consults/visit/index.dart | 0 .../visit/model.dart} | 10 +- .../visit/widget.dart} | 15 +- lib/pages/home/index.dart | 0 .../home_page_model.dart => home/model.dart} | 17 +- lib/pages/home/widget.dart | 670 ++++++++++ lib/pages/home_page/home_page_widget.dart | 1183 ----------------- lib/pages/index.dart | 8 + .../message_history_page_widget.dart | 290 ---- lib/pages/onboarding/index.dart | 0 .../onboarding/signin/component.dart} | 74 +- .../signin/model.dart} | 7 +- .../signin/widget.dart} | 13 +- .../onboarding/signup/component.dart} | 127 +- .../signup/model.dart} | 8 +- .../signup/widget.dart} | 13 +- .../onboarding/welcome/component.dart} | 23 +- .../welcome/model.dart} | 7 +- .../welcome/widget.dart} | 13 +- lib/pages/registers/index.dart | 0 .../registers/visitor/component.dart} | 77 +- lib/pages/registers/visitor/index.dart | 0 .../visitor/model.dart} | 9 +- .../visitor/widget.dart} | 25 +- lib/pages/schedules/index.dart | 0 .../visit/complete/model.dart} | 10 +- .../visit/complete/widget.dart} | 175 +-- .../visit/fastpass/widget.dart} | 4 +- lib/pages/schedules/visit/index.dart | 0 .../visit/provisional/model.dart} | 7 +- .../visit/provisional/widget.dart} | 21 +- lib/pages/settings/index.dart | 0 .../model.dart} | 17 +- .../widget.dart} | 100 +- lib/pages/test_page/test_page.dart | 63 - pubspec.yaml | 2 +- test/widget_test.dart | 2 +- 241 files changed, 3065 insertions(+), 3955 deletions(-) delete mode 100644 lib/backend/schema/structs/index.dart rename lib/{ => commons}/actions/actions.dart (77%) rename lib/{backend/api_requests => commons/actions}/api_calls.dart (99%) rename lib/{backend/api_requests => commons/actions}/api_manager.dart (99%) rename lib/{custom_code => commons}/actions/convert_image_file_to_base64.dart (51%) rename lib/{custom_code => commons}/actions/convert_to_upload_file.dart (73%) rename lib/{custom_code => commons}/actions/get_dev_u_u_i_d.dart (91%) rename lib/{backend/api_requests => commons/actions}/get_streamed_response.dart (100%) rename lib/{custom_code => commons}/actions/index.dart (60%) rename lib/{flutter_flow/nav => commons/actions}/nav.dart (89%) rename lib/{backend/push_notification => commons/actions}/pushNotificationService.dart (72%) rename lib/{flutter_flow/nav => commons/actions}/serialization_util.dart (96%) rename lib/{backend/push_notification => commons/actions}/tapNotifcationActivity.dart (95%) create mode 100644 lib/commons/components/atoms/index.dart create mode 100644 lib/commons/components/atoms/local_header/index.dart rename lib/{components/organism_components/local_profile_component/local_profile_component_model.dart => commons/components/atoms/local_header/model.dart} (63%) rename lib/{components/organism_components/local_profile_component/local_profile_component_widget.dart => commons/components/atoms/local_header/widget.dart} (91%) create mode 100644 lib/commons/components/atoms/menu_button_item/index.dart create mode 100644 lib/commons/components/atoms/menu_button_item/widget.dart create mode 100644 lib/commons/components/atoms/menu_card_item/index.dart create mode 100644 lib/commons/components/atoms/menu_card_item/widget.dart create mode 100644 lib/commons/components/index.dart create mode 100644 lib/commons/components/molecules/card/index.dart rename lib/{components/templates_components/card_item_template_component/card_item_template_component_model.dart => commons/components/molecules/card/model.dart} (62%) rename lib/{components/templates_components/card_item_template_component/card_item_template_component_widget.dart => commons/components/molecules/card/widget.dart} (79%) create mode 100644 lib/commons/components/molecules/header/index.dart create mode 100644 lib/commons/components/molecules/index.dart create mode 100644 lib/commons/components/molecules/menu_item/index.dart create mode 100644 lib/commons/components/molecules/menu_item/widget.dart create mode 100644 lib/commons/components/molecules/menu_list_view/index.dart rename lib/{components/organism_components/menu_list_view_component/menu_list_view_component_model.dart => commons/components/molecules/menu_list_view/model.dart} (63%) create mode 100644 lib/commons/components/molecules/menu_list_view/widget.dart create mode 100644 lib/commons/components/molecules/menu_staggered_view/index.dart rename lib/{components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart => commons/components/molecules/menu_staggered_view/model.dart} (62%) rename lib/{components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart => commons/components/molecules/menu_staggered_view/widget.dart} (99%) create mode 100644 lib/commons/components/molecules/message_well/index.dart rename lib/{components/organism_components/message_well_component/message_well_component_model.dart => commons/components/molecules/message_well/model.dart} (83%) rename lib/{components/organism_components/message_well_component/message_well_component_widget.dart => commons/components/molecules/message_well/widget.dart} (97%) create mode 100644 lib/commons/components/molecules/well/index.dart create mode 100644 lib/commons/components/organisms/index.dart create mode 100644 lib/commons/components/organisms/menu/index.dart rename lib/{components/organism_components/menu_component/menu_component_model.dart => commons/components/organisms/menu/model.dart} (84%) create mode 100644 lib/commons/components/organisms/menu/widget.dart create mode 100644 lib/commons/components/templates/browser/index.dart create mode 100644 lib/commons/components/templates/consult/index.dart create mode 100644 lib/commons/components/templates/consult/model.dart create mode 100644 lib/commons/components/templates/consult/widget.dart create mode 100644 lib/commons/components/templates/detail/index.dart create mode 100644 lib/commons/components/templates/exception/index.dart rename lib/{components/molecular_components/throw_exception/throw_exception_model.dart => commons/components/templates/exception/model.dart} (64%) rename lib/{components/molecular_components/throw_exception/throw_exception_widget.dart => commons/components/templates/exception/widget.dart} (96%) create mode 100644 lib/commons/components/templates/filter/index.dart create mode 100644 lib/commons/components/templates/forms/index.dart create mode 100644 lib/commons/components/templates/index.dart create mode 100644 lib/commons/components/templates/notification/index.dart create mode 100644 lib/commons/components/templates/register/index.dart create mode 100644 lib/commons/components/templates/register/mode.dart create mode 100644 lib/commons/components/templates/register/widget.dart create mode 100644 lib/commons/components/templates/schedule/index.dart create mode 100644 lib/commons/components/templates/schedule/model.dart create mode 100644 lib/commons/components/templates/schedule/widget.dart create mode 100644 lib/commons/components/templates/setting/index.dart create mode 100644 lib/commons/components/templates/setting/model.dart create mode 100644 lib/commons/components/templates/setting/widget.dart create mode 100644 lib/commons/components/templates/welcome/index.dart create mode 100644 lib/commons/components/templates/welcome/model.dart create mode 100644 lib/commons/components/templates/welcome/widget.dart rename lib/{backend => commons}/schema/enums/enums.dart (85%) create mode 100644 lib/commons/schema/enums/index.dart create mode 100644 lib/commons/schema/index.dart rename lib/{backend => commons}/schema/structs/device_struct.dart (96%) create mode 100644 lib/commons/schema/structs/index.dart create mode 100644 lib/commons/schema/util/index.dart rename lib/{backend => commons}/schema/util/schema_util.dart (95%) create mode 100644 lib/commons/widgets/a11y/index.dart create mode 100644 lib/commons/widgets/control/index.dart rename lib/{flutter_flow => commons/widgets}/custom_functions.dart (97%) rename lib/{flutter_flow => commons/widgets}/custom_icons.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_animations.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_button_tabbar.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_checkbox_group.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_drop_down.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_icon_button.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_model.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_theme.dart (100%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_util.dart (99%) rename lib/{flutter_flow => commons/widgets}/flutter_flow_widgets.dart (100%) rename lib/{flutter_flow => commons/widgets}/form_field_controller.dart (100%) create mode 100644 lib/commons/widgets/image_cropper.dart rename lib/{custom_code => commons}/widgets/index.dart (100%) create mode 100644 lib/commons/widgets/info/index.dart rename lib/{flutter_flow => commons/widgets}/internationalization.dart (100%) create mode 100644 lib/commons/widgets/io/index.dart create mode 100644 lib/commons/widgets/io/textfield/index.dart rename lib/{components/atomic_components/text_field_component/text_field_component_model.dart => commons/widgets/io/textfield/model.dart} (81%) rename lib/{components/atomic_components/text_field_component/text_field_component_widget.dart => commons/widgets/io/textfield/widget.dart} (95%) rename lib/{flutter_flow => commons/widgets}/keep_alive_wrapper.dart (100%) rename lib/{flutter_flow => commons/widgets}/lat_lng.dart (100%) create mode 100644 lib/commons/widgets/layout/index.dart create mode 100644 lib/commons/widgets/menu.dart create mode 100644 lib/commons/widgets/nav/index.dart rename lib/{flutter_flow => commons/widgets}/permissions_util.dart (100%) rename lib/{flutter_flow => commons/widgets}/place.dart (100%) rename lib/{flutter_flow => commons/widgets}/random_data_util.dart (100%) rename lib/{flutter_flow => commons/widgets}/request_manager.dart (100%) create mode 100644 lib/commons/widgets/scroll/index.dart create mode 100644 lib/commons/widgets/style/index.dart rename lib/{flutter_flow => commons/widgets}/upload_data.dart (100%) rename lib/{flutter_flow => commons/widgets}/uploaded_file.dart (100%) create mode 100644 lib/commons/widgets/view/index.dart delete mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart delete mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart delete mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart delete mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart delete mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart delete mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart delete mode 100644 lib/custom_code/widgets/image_cropper.dart create mode 100644 lib/modals/browsers/index.dart create mode 100644 lib/modals/browsers/visitor_browser/index.dart rename lib/{components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart => modals/browsers/visitor_browser/model.dart} (91%) rename lib/{components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart => modals/browsers/visitor_browser/widget.dart} (97%) create mode 100644 lib/modals/details/index.dart create mode 100644 lib/modals/details/liberation_history_item_details/index.dart rename lib/{components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart => modals/details/liberation_history_item_details/model.dart} (92%) rename lib/{components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart => modals/details/liberation_history_item_details/widget.dart} (98%) create mode 100644 lib/modals/details/schedule_visit_detail/index.dart rename lib/{components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart => modals/details/schedule_visit_detail/model.dart} (92%) rename lib/{components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart => modals/details/schedule_visit_detail/widget.dart} (98%) create mode 100644 lib/modals/details/view_visit_detail/index.dart rename lib/{components/view_visit_detail/view_visit_detail_model.dart => modals/details/view_visit_detail/model.dart} (92%) rename lib/{components/view_visit_detail/view_visit_detail_widget.dart => modals/details/view_visit_detail/widget.dart} (98%) create mode 100644 lib/modals/details/visit_details_modal/index.dart rename lib/{components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart => modals/details/visit_details_modal/model.dart} (77%) rename lib/{components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart => modals/details/visit_details_modal/widget.dart} (91%) create mode 100644 lib/modals/details/visitor_details_modal/index.dart rename lib/{components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart => modals/details/visitor_details_modal/model.dart} (73%) rename lib/{components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart => modals/details/visitor_details_modal/widget.dart} (98%) create mode 100644 lib/modals/exceptions/error/index.dart create mode 100644 lib/modals/exceptions/index.dart create mode 100644 lib/modals/exceptions/info/index.dart create mode 100644 lib/modals/exceptions/not_found/index.dart rename lib/{components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart => modals/exceptions/not_found/model.dart} (73%) rename lib/{components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart => modals/exceptions/not_found/widget.dart} (93%) create mode 100644 lib/modals/exceptions/warning/index.dart create mode 100644 lib/modals/filters/access_filter/index.dart rename lib/{components/molecular_components/message_opt_modal/opt_modal_model.dart => modals/filters/access_filter/model.dart} (86%) rename lib/{components/molecular_components/message_opt_modal/opt_modal_widget.dart => modals/filters/access_filter/widget.dart} (98%) create mode 100644 lib/modals/filters/options/index.dart rename lib/{components/molecular_components/opt_modal/opt_modal_model.dart => modals/filters/options/model.dart} (86%) rename lib/{components/molecular_components/opt_modal/opt_modal_widget.dart => modals/filters/options/widget.dart} (98%) create mode 100644 lib/modals/filters/selections/index.dart rename lib/{components/molecular_components/option_selection_modal/option_selection_modal_model.dart => modals/filters/selections/model.dart} (64%) rename lib/{components/molecular_components/option_selection_modal/option_selection_modal_widget.dart => modals/filters/selections/widget.dart} (96%) create mode 100644 lib/modals/forms/change_password/index.dart rename lib/{components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart => modals/forms/change_password/model.dart} (94%) rename lib/{components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart => modals/forms/change_password/widget.dart} (98%) create mode 100644 lib/modals/forms/forgot_password/index.dart rename lib/{components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart => modals/forms/forgot_password/model.dart} (83%) rename lib/{components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart => modals/forms/forgot_password/widget.dart} (97%) create mode 100644 lib/modals/forms/index.dart create mode 100644 lib/modals/forms/qr_code/index.dart rename lib/{components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart => modals/forms/qr_code/model.dart} (91%) rename lib/{components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart => modals/forms/qr_code/widget.dart} (97%) create mode 100644 lib/modals/index.dart create mode 100644 lib/modals/notifications/access_notification/index.dart rename lib/{components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart => modals/notifications/access_notification/model.dart} (92%) rename lib/{components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart => modals/notifications/access_notification/widget.dart} (98%) create mode 100644 lib/modals/notifications/index.dart create mode 100644 lib/modals/notifications/message_notificaion/index.dart rename lib/{components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart => modals/notifications/message_notificaion/model.dart} (92%) rename lib/{components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart => modals/notifications/message_notificaion/widget.dart} (98%) create mode 100644 lib/modals/notifications/visit_request/index.dart rename lib/{components/templates_components/visit_request_template_component/visit_request_template_component_model.dart => modals/notifications/visit_request/model.dart} (92%) rename lib/{components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart => modals/notifications/visit_request/widget.dart} (99%) create mode 100644 lib/modals/selection/bottom_arrow_linked_locals/index.dart rename lib/{components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart => modals/selection/bottom_arrow_linked_locals/model.dart} (73%) rename lib/{components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart => modals/selection/bottom_arrow_linked_locals/widget.dart} (97%) create mode 100644 lib/modals/selection/index.dart create mode 100644 lib/modals/selection/top_arrow_linked_locals/index.dart rename lib/{components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart => modals/selection/top_arrow_linked_locals/model.dart} (73%) rename lib/{components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart => modals/selection/top_arrow_linked_locals/widget.dart} (84%) create mode 100644 lib/modals/selection/up_arrow_linked_locals/index.dart rename lib/{components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart => modals/selection/up_arrow_linked_locals/model.dart} (73%) rename lib/{components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart => modals/selection/up_arrow_linked_locals/widget.dart} (97%) create mode 100644 lib/pages/consults/access/index.dart rename lib/pages/{acess_history_page/acess_history_page_model.dart => consults/access/model.dart} (84%) rename lib/pages/{acess_history_page/acess_history_page_widget.dart => consults/access/widget.dart} (92%) create mode 100644 lib/pages/consults/index.dart create mode 100644 lib/pages/consults/liberation/index.dart rename lib/pages/{liberation_history/liberation_history_model.dart => consults/liberation/model.dart} (86%) rename lib/pages/{liberation_history/liberation_history_widget.dart => consults/liberation/widget.dart} (94%) create mode 100644 lib/pages/consults/message/index.dart rename lib/pages/{message_history_page/message_history_page_model.dart => consults/message/model.dart} (79%) create mode 100644 lib/pages/consults/message/widget.dart create mode 100644 lib/pages/consults/poeple/index.dart rename lib/pages/{people_on_the_property_page/people_on_the_property_page_model.dart => consults/poeple/model.dart} (80%) rename lib/pages/{people_on_the_property_page/people_on_the_property_page_widget.dart => consults/poeple/widget.dart} (95%) create mode 100644 lib/pages/consults/qrcode/index.dart rename lib/pages/{qr_code_page/qr_code_page_model.dart => consults/qrcode/model.dart} (84%) rename lib/pages/{qr_code_page/qr_code_page_widget.dart => consults/qrcode/widget.dart} (89%) create mode 100644 lib/pages/consults/visit/index.dart rename lib/pages/{visit_history_page/visit_history_page_model.dart => consults/visit/model.dart} (91%) rename lib/pages/{visit_history_page/visit_history_page_widget.dart => consults/visit/widget.dart} (98%) create mode 100644 lib/pages/home/index.dart rename lib/pages/{home_page/home_page_model.dart => home/model.dart} (72%) create mode 100644 lib/pages/home/widget.dart delete mode 100644 lib/pages/home_page/home_page_widget.dart create mode 100644 lib/pages/index.dart delete mode 100644 lib/pages/message_history_page/message_history_page_widget.dart create mode 100644 lib/pages/onboarding/index.dart rename lib/{components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart => pages/onboarding/signin/component.dart} (96%) rename lib/pages/{sign_in_page/sign_in_page_model.dart => onboarding/signin/model.dart} (73%) rename lib/pages/{sign_in_page/sign_in_page_widget.dart => onboarding/signin/widget.dart} (81%) rename lib/{components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart => pages/onboarding/signup/component.dart} (94%) rename lib/pages/{sign_up_page/sign_up_page_model.dart => onboarding/signup/model.dart} (73%) rename lib/pages/{sign_up_page/sign_up_page_widget.dart => onboarding/signup/widget.dart} (81%) rename lib/{components/templates_components/welcome_template_component/welcome_template_component_widget.dart => pages/onboarding/welcome/component.dart} (98%) rename lib/pages/{welcome_page/welcome_page_model.dart => onboarding/welcome/model.dart} (75%) rename lib/pages/{welcome_page/welcome_page_widget.dart => onboarding/welcome/widget.dart} (86%) create mode 100644 lib/pages/registers/index.dart rename lib/{components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart => pages/registers/visitor/component.dart} (94%) create mode 100644 lib/pages/registers/visitor/index.dart rename lib/pages/{register_visitor_page/register_visitor_page_model.dart => registers/visitor/model.dart} (89%) rename lib/pages/{register_visitor_page/register_visitor_page_widget.dart => registers/visitor/widget.dart} (98%) create mode 100644 lib/pages/schedules/index.dart rename lib/pages/{schedule_complete_visit_page/schedule_complete_visit_page_model.dart => schedules/visit/complete/model.dart} (92%) rename lib/pages/{schedule_complete_visit_page/schedule_complete_visit_page_widget.dart => schedules/visit/complete/widget.dart} (94%) rename lib/pages/{fast_pass_page/fast_pass_page_widget.dart => schedules/visit/fastpass/widget.dart} (97%) create mode 100644 lib/pages/schedules/visit/index.dart rename lib/pages/{schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart => schedules/visit/provisional/model.dart} (93%) rename lib/pages/{schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart => schedules/visit/provisional/widget.dart} (98%) create mode 100644 lib/pages/settings/index.dart rename lib/pages/{preferences_settings_page/preferences_settings_model.dart => settings/model.dart} (87%) rename lib/pages/{preferences_settings_page/preferences_settings_widget.dart => settings/widget.dart} (52%) delete mode 100644 lib/pages/test_page/test_page.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 87d8dd6f..1994e1c8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,7 +10,7 @@ diff --git a/lib/app_state.dart b/lib/app_state.dart index 0faaaeca..a0918b1c 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,6 +1,6 @@ import 'dart:ffi'; -import 'package:f_r_e_hub/flutter_flow/permissions_util.dart'; +import 'commons/widgets/permissions_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:csv/csv.dart'; diff --git a/lib/backend/schema/structs/index.dart b/lib/backend/schema/structs/index.dart deleted file mode 100644 index 4affa264..00000000 --- a/lib/backend/schema/structs/index.dart +++ /dev/null @@ -1,3 +0,0 @@ -export '/backend/schema/util/schema_util.dart'; - -export 'device_struct.dart'; diff --git a/lib/actions/actions.dart b/lib/commons/actions/actions.dart similarity index 77% rename from lib/actions/actions.dart rename to lib/commons/actions/actions.dart index d25a5939..e63acea4 100644 --- a/lib/actions/actions.dart +++ b/lib/commons/actions/actions.dart @@ -1,20 +1,23 @@ import 'dart:convert'; +import 'dart:developer'; -import 'package:f_r_e_hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import 'package:f_r_e_hub/custom_code/actions/get_dev_u_u_i_d.dart'; -import 'package:f_r_e_hub/pages/home_page/home_page_widget.dart'; +// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/modals/filters/selections/widget.dart'; +import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; +import 'package:hub/pages/home/model.dart'; +import 'package:hub/pages/home/widget.dart'; +import 'package:hub/commons/actions/get_dev_u_u_i_d.dart'; import 'package:flutter/material.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:sqflite/utils/utils.dart'; -import 'dart:developer'; -import '/actions/actions.dart' as action_blocks; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/custom_code/actions/index.dart' as actions; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/random_data_util.dart' as random_data; +import '/commons/actions/actions.dart' as action_blocks; +import '/commons/actions/api_calls.dart'; +import '/commons/actions/index.dart' as actions; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/random_data_util.dart' as random_data; Future repeatVisitScheduleAction( BuildContext context, { @@ -651,4 +654,140 @@ Widget buildQrCode( // String escapeMECARD(String content) { // // Implementação para escapar caracteres. // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } \ No newline at end of file + // } + + /// menu + + Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], + ), + ); + }, + ); + } + + Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); + } + + Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], + ), + ); + }, + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } diff --git a/lib/backend/api_requests/api_calls.dart b/lib/commons/actions/api_calls.dart similarity index 99% rename from lib/backend/api_requests/api_calls.dart rename to lib/commons/actions/api_calls.dart index 15850cd4..67ec207f 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/commons/actions/api_calls.dart @@ -4,7 +4,7 @@ import 'dart:developer'; import 'package:flutter/foundation.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'api_manager.dart'; export 'api_manager.dart' show ApiCallResponse; diff --git a/lib/backend/api_requests/api_manager.dart b/lib/commons/actions/api_manager.dart similarity index 99% rename from lib/backend/api_requests/api_manager.dart rename to lib/commons/actions/api_manager.dart index 1bb57424..dcb91c8a 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/commons/actions/api_manager.dart @@ -11,7 +11,7 @@ import 'package:equatable/equatable.dart'; import 'package:http_parser/http_parser.dart'; import 'package:mime_type/mime_type.dart'; -import '/flutter_flow/uploaded_file.dart'; +import '/commons/widgets/uploaded_file.dart'; import 'get_streamed_response.dart'; diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart b/lib/commons/actions/convert_image_file_to_base64.dart similarity index 51% rename from lib/custom_code/actions/convert_image_file_to_base64.dart rename to lib/commons/actions/convert_image_file_to_base64.dart index 595a0468..19ff6095 100644 --- a/lib/custom_code/actions/convert_image_file_to_base64.dart +++ b/lib/commons/actions/convert_image_file_to_base64.dart @@ -1,15 +1,12 @@ // Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/schema/structs/index.dart'; +import '/commons/schema/enums/enums.dart'; +import '/commons/actions/actions.dart' as action_blocks; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions +import '/commons/widgets/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; -// Begin custom action code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! - import 'dart:convert'; import 'dart:typed_data'; diff --git a/lib/custom_code/actions/convert_to_upload_file.dart b/lib/commons/actions/convert_to_upload_file.dart similarity index 73% rename from lib/custom_code/actions/convert_to_upload_file.dart rename to lib/commons/actions/convert_to_upload_file.dart index da9e3dae..2ddde316 100644 --- a/lib/custom_code/actions/convert_to_upload_file.dart +++ b/lib/commons/actions/convert_to_upload_file.dart @@ -1,11 +1,11 @@ // Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/schema/structs/index.dart'; +import '/commons/schema/enums/enums.dart'; +import '/commons/actions/actions.dart' as action_blocks; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions +import '/commons/widgets/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/commons/actions/get_dev_u_u_i_d.dart similarity index 91% rename from lib/custom_code/actions/get_dev_u_u_i_d.dart rename to lib/commons/actions/get_dev_u_u_i_d.dart index 7fb469f1..b9226900 100644 --- a/lib/custom_code/actions/get_dev_u_u_i_d.dart +++ b/lib/commons/actions/get_dev_u_u_i_d.dart @@ -1,13 +1,13 @@ -import '/backend/schema/structs/index.dart'; +import '/commons/schema/structs/index.dart'; import 'dart:developer'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/schema/enums/enums.dart'; +import '/commons/actions/actions.dart' as action_blocks; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions +import '/commons/widgets/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; diff --git a/lib/backend/api_requests/get_streamed_response.dart b/lib/commons/actions/get_streamed_response.dart similarity index 100% rename from lib/backend/api_requests/get_streamed_response.dart rename to lib/commons/actions/get_streamed_response.dart diff --git a/lib/custom_code/actions/index.dart b/lib/commons/actions/index.dart similarity index 60% rename from lib/custom_code/actions/index.dart rename to lib/commons/actions/index.dart index 2110f043..0a097ef0 100644 --- a/lib/custom_code/actions/index.dart +++ b/lib/commons/actions/index.dart @@ -1,3 +1,6 @@ export 'convert_image_file_to_base64.dart' show convertImageFileToBase64; export 'convert_to_upload_file.dart' show convertToUploadFile; export 'get_dev_u_u_i_d.dart' show getDevUUID; +export 'actions.dart' show Actions; +export 'api_calls.dart' show ApiCalls; +export 'api_manager.dart' show ApiManager; diff --git a/lib/flutter_flow/nav/nav.dart b/lib/commons/actions/nav.dart similarity index 89% rename from lib/flutter_flow/nav/nav.dart rename to lib/commons/actions/nav.dart index 6eed8f03..955e4cce 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/commons/actions/nav.dart @@ -1,15 +1,32 @@ import 'dart:async'; -import 'package:f_r_e_hub/pages/fast_pass_page/fast_pass_page_widget.dart'; -import 'package:f_r_e_hub/pages/message_history_page/message_history_page_widget.dart'; -import 'package:f_r_e_hub/pages/preferences_settings_page/preferences_settings_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; +// import 'package:hub/pages/consult/access/acess_history_page_widget.dart'; +// import 'package:hub/pages/schedule/visit/fastpass/fast_pass_page_widget.dart'; +// import 'package:hub/pages/consult/message/message_history_page_widget.dart'; +// import 'package:hub/pages/settings/preferences_settings_widget.dart'; +// import 'package:hub/pages/consult/visit/visit_history_page_widget.dart'; -import '/backend/schema/structs/index.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:hub/pages/consults/access/widget.dart'; +import 'package:hub/pages/consults/liberation/widget.dart'; +import 'package:hub/pages/consults/message/widget.dart'; +import 'package:hub/pages/consults/poeple/widget.dart'; +import 'package:hub/pages/consults/qrcode/widget.dart'; +import 'package:hub/pages/consults/visit/widget.dart'; +import 'package:hub/pages/home/widget.dart'; +import 'package:hub/pages/onboarding/signin/widget.dart'; +import 'package:hub/pages/onboarding/signup/widget.dart'; +import 'package:hub/pages/onboarding/welcome/widget.dart'; +import 'package:hub/pages/registers/visitor/widget.dart'; +import 'package:hub/pages/schedules/visit/complete/widget.dart'; +import 'package:hub/pages/schedules/visit/fastpass/widget.dart'; +import 'package:hub/pages/schedules/visit/provisional/widget.dart'; +import 'package:hub/pages/settings/widget.dart'; +import 'package:provider/provider.dart'; +import '/commons/schema/structs/index.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import '/index.dart'; -import '../../pages/visit_history_page/visit_history_page_widget.dart'; +// import '../../pages//visit_history_page_widget.dart'; export 'package:go_router/go_router.dart'; diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/commons/actions/pushNotificationService.dart similarity index 72% rename from lib/backend/push_notification/pushNotificationService.dart rename to lib/commons/actions/pushNotificationService.dart index 8ec899a1..c8dfa7f5 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/commons/actions/pushNotificationService.dart @@ -4,18 +4,16 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/app_state.dart'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/actions.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/commons/actions/api_manager.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:hub/modals/notifications/access_notification/widget.dart'; +import 'package:hub/modals/notifications/message_notificaion/widget.dart'; +import 'package:hub/modals/notifications/visit_request/widget.dart'; import 'package:rxdart/rxdart.dart'; class PushNotificationService { @@ -108,17 +106,17 @@ class PushNotificationService { await Future.delayed(Duration(milliseconds: 100)); } - const initializationSettingsAndroid = AndroidInitializationSettings('mipmap/ic_fre_black'); - const initializationSettingsIOS = DarwinInitializationSettings( + var initializationSettingsAndroid = + AndroidInitializationSettings('mipmap/ic_fre_black'); + var initializationSettingsIOS = DarwinInitializationSettings( requestAlertPermission: true, requestBadgePermission: true, requestSoundPermission: true, ); - const initializationSettings = InitializationSettings( + var initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsIOS, ); - _flutterLocalNotificationsPlugin.initialize( initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse response) async { @@ -187,17 +185,7 @@ class PushNotificationService { _onMessage.add(message); log('Extra: ${message.notification?.body}'); - Map extra = {}; - log('Message: ${message.data}'); - - if (message.data['click_action'] == 'mensagem') { - extra['body'] = message.notification?.body; - } - - log('New Extra: $extra'); - - NotificationHandler().handleMessage(message.data, context, extra: extra); - }); + NotificationHandler().handleMessage(message.data, context); }); } void configureTokenRefresh() { @@ -273,11 +261,8 @@ class PushNotificationService { } void _showNotification(RemoteMessage message) async { - Map messageParsed = message.toMap(); - Map data = messageParsed['data']; - Map notification = messageParsed['notification']; - - String channelId = _getChannelIdBasedOnClickAction(data['click_action']); + String channelId = + _getChannelIdBasedOnClickAction(message.data['click_action']); var androidDetails = AndroidNotificationDetails( channelId, @@ -286,33 +271,19 @@ class PushNotificationService { importance: Importance.max, priority: Priority.high, ); - var iOSDetails = const DarwinNotificationDetails( - categoryIdentifier: 'plainCategory', - sound: 'slow_spring_board.aiff', - presentList: true, - interruptionLevel: InterruptionLevel.critical, - ); - - var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails); + var iOSDetails = DarwinNotificationDetails(); + var generalNotificationDetails = + NotificationDetails(android: androidDetails, iOS: iOSDetails); log('Showing notification: ${message.messageId.hashCode}'); - log('Message Title: ${notification['title'].toString()}'); - log('Message Body: ${notification['body'].toString()}'); - log('Message Payload: ${data.toString()}'); - await _flutterLocalNotificationsPlugin.show( - DateTime.now().microsecond, - notification['title'].toString(), - notification['body'].toString(), + // DateTime.now().millisecondsSinceEpoch % (1 << 31), + math.Random().nextInt(1 << 30), + message.notification?.title, + message.notification?.body, generalNotificationDetails, - payload: data.toString(), - ).catchError((err, stack) { - log('Error: $err'); - log('Stack: $stack'); - }); - - - + payload: message.data.toString(), + ); } _handleNotificationClick(Map payload, {Map extra = const {}}) { @@ -347,15 +318,15 @@ class NotificationHandler { switch (message['click_action']) { case 'visit_request': _showVisitRequestDialog(message, context); + break; - case 'cancel_request': - _showVisitRequestResolvedDialog(message, context); + case '': break; case 'access': _showAcessNotificationModal(message, context); break; case 'mensagem': - _showMessageNotificationDialog(message, context, extra); + _showMessageNotificationDialog(message, context, extra); break; case 'enroll_cond': log('enroll_cond'); @@ -382,7 +353,6 @@ class NotificationHandler { void _showAcessNotificationModal( Map message, BuildContext context) { log('Showing access notification dialog'); - log('Message: ${message}'); log('USR_TIPO: ${message['USR_TIPO']}'); log('USR_ID: ${message['USR_ID']}'); log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}'); @@ -390,27 +360,21 @@ class NotificationHandler { context: context, builder: (BuildContext context) { String id = _getIdBasedOnUserType(message); - - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: AccessNotificationModalTemplateComponentWidget( - datetime: message['ACE_DATAHORA'].toString(), - drive: message['SET_DESCRICAO'].toString(), - id: message['USR_TIPO'].toString() == 'O' - ? message['USR_ID'].toString() == '' - ? '0' - : message['USR_ID'].toString() - : message['USR_DOCUMENTO'].toString() == '' - ? '0' - : message['USR_DOCUMENTO'].toString(), - name: message['PES_NOME'].toString(), - type: message['USR_TIPO'], - )), - ); + return Dialog( + backgroundColor: Colors.transparent, + child: AccessNotificationModalTemplateComponentWidget( + datetime: message['ACE_DATAHORA'].toString(), + drive: message['ACI_DESCRICAO'].toString(), + id: message['USR_TIPO'].toString() == 'O' + ? message['USR_ID'].toString() == '' + ? '0' + : message['USR_ID'].toString() + : message['USR_DOCUMENTO'].toString() == '' + ? '0' + : message['USR_DOCUMENTO'].toString(), + name: message['PES_NOME'].toString(), + type: message['USR_TIPO'], + )); }, ); } @@ -419,31 +383,17 @@ class NotificationHandler { Map message, BuildContext context, Map extra) { log('Showing message notification dialog'); log('Notification "message": $message'); - log('Extra: $extra'); - Map local = {}; - - try { - local = jsonDecode(message['local']); - } catch (err) { - local = message['local']; - } - showDialog( useSafeArea: true, context: context, builder: (BuildContext context) { - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: MessageNotificationModalTemplateComponentWidget( - id: local['CLI_ID'].toString(), - from: message['remetente'].toString(), - to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', - message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), - ), + return Dialog( + backgroundColor: Colors.transparent, + child: MessageNotificationModalTemplateComponentWidget( + id: message['local']['CLI_ID'].toString(), + from: message['remetente'].toString(), + to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', + message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), ), ); }, @@ -474,35 +424,6 @@ class NotificationHandler { }, ); } - - void _showVisitRequestResolvedDialog( - Map message, BuildContext context) { - log('Showing visit request notification dialog'); - - showDialog( - context: context, - builder: (BuildContext context) { - - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: VisitRequestTemplateComponentWidget( - vteName: message['nomevisita'].toString(), - vteReason: message['motivo'].toString(), - vteMsg: message['resposta'].toString(), - vteDocument: message['documento'].toString(), - vteUUID: message['codvisita'].toString(), - vawRef: message['referencia'].toString(), - vawStatus: message['status'].toString(), - ), - ), - ); - }, - ); - } } class PushNotificationManager { diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/commons/actions/serialization_util.dart similarity index 96% rename from lib/flutter_flow/nav/serialization_util.dart rename to lib/commons/actions/serialization_util.dart index f9665c41..6b04b1b2 100644 --- a/lib/flutter_flow/nav/serialization_util.dart +++ b/lib/commons/actions/serialization_util.dart @@ -3,12 +3,12 @@ import 'dart:developer'; import 'package:flutter/material.dart'; -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; +import '/commons/schema/structs/index.dart'; +import '/commons/schema/enums/enums.dart'; -import '../../flutter_flow/lat_lng.dart'; -import '../../flutter_flow/place.dart'; -import '../../flutter_flow/uploaded_file.dart'; +import '/commons/widgets/lat_lng.dart'; +import '/commons/widgets/place.dart'; +import '/commons/widgets/uploaded_file.dart'; /// SERIALIZATION HELPERS diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart b/lib/commons/actions/tapNotifcationActivity.dart similarity index 95% rename from lib/backend/push_notification/tapNotifcationActivity.dart rename to lib/commons/actions/tapNotifcationActivity.dart index 1ee22050..064ee82b 100644 --- a/lib/backend/push_notification/tapNotifcationActivity.dart +++ b/lib/commons/actions/tapNotifcationActivity.dart @@ -1,4 +1,4 @@ -// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +// import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; // import 'package:firebase_messaging/firebase_messaging.dart'; // import 'package:flutter/material.dart'; // import 'package:rxdart/rxdart.dart'; diff --git a/lib/commons/components/atoms/index.dart b/lib/commons/components/atoms/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/local_header/index.dart b/lib/commons/components/atoms/local_header/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/commons/components/atoms/local_header/model.dart similarity index 63% rename from lib/components/organism_components/local_profile_component/local_profile_component_model.dart rename to lib/commons/components/atoms/local_header/model.dart index 25442482..befb297d 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart +++ b/lib/commons/components/atoms/local_header/model.dart @@ -1,5 +1,6 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; +import 'package:hub/commons/components/atoms/local_header/widget.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; class LocalProfileComponentModel diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/commons/components/atoms/local_header/widget.dart similarity index 91% rename from lib/components/organism_components/local_profile_component/local_profile_component_widget.dart rename to lib/commons/components/atoms/local_header/widget.dart index d8b1aff4..047ae944 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/commons/components/atoms/local_header/widget.dart @@ -1,15 +1,16 @@ -import 'package:f_r_e_hub/actions/actions.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/random_data_util.dart' as random_data; + +import 'package:hub/commons/components/atoms/local_header/model.dart'; +import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/custom_functions.dart' as functions; +import '/commons/widgets/random_data_util.dart' as random_data; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'local_profile_component_model.dart'; -export 'local_profile_component_model.dart'; +export 'model.dart'; class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({ diff --git a/lib/commons/components/atoms/menu_button_item/index.dart b/lib/commons/components/atoms/menu_button_item/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/menu_button_item/widget.dart b/lib/commons/components/atoms/menu_button_item/widget.dart new file mode 100644 index 00000000..83388793 --- /dev/null +++ b/lib/commons/components/atoms/menu_button_item/widget.dart @@ -0,0 +1,147 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/components/molecules/menu_item/widget.dart'; +import 'package:hub/commons/widgets/custom_icons.dart'; +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/commons/widgets/internationalization.dart'; + + + + +class MenuButtonWidget extends MenuEntry { + const MenuButtonWidget({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); +} + +class _MenuButtonWidgetState extends State { + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + widget.icon, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Text( + widget.title ?? '', + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/commons/components/atoms/menu_card_item/index.dart b/lib/commons/components/atoms/menu_card_item/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/menu_card_item/widget.dart b/lib/commons/components/atoms/menu_card_item/widget.dart new file mode 100644 index 00000000..5204dea7 --- /dev/null +++ b/lib/commons/components/atoms/menu_card_item/widget.dart @@ -0,0 +1,109 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/components/molecules/menu_item/widget.dart'; +import 'package:hub/commons/widgets/custom_icons.dart'; +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; + + + + +class MenuButtonWidget extends MenuEntry { + const MenuButtonWidget({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); +} + +class _MenuButtonWidgetState extends State { + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kfast, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + widget.title ?? 'Menu Item', + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + widget.icon, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/commons/components/index.dart b/lib/commons/components/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/card/index.dart b/lib/commons/components/molecules/card/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/commons/components/molecules/card/model.dart similarity index 62% rename from lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart rename to lib/commons/components/molecules/card/model.dart index 3f35acf9..43508738 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart +++ b/lib/commons/components/molecules/card/model.dart @@ -1,8 +1,8 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'card_item_template_component_widget.dart' - show CardItemTemplateComponentWidget; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; +import 'widget.dart'; + class CardItemTemplateComponentModel extends FlutterFlowModel { @override diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/commons/components/molecules/card/widget.dart similarity index 79% rename from lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart rename to lib/commons/components/molecules/card/widget.dart index 41c28eee..47f1a027 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/commons/components/molecules/card/widget.dart @@ -1,14 +1,15 @@ import 'dart:collection'; import 'dart:developer'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'card_item_template_component_model.dart'; -export 'card_item_template_component_model.dart'; + +import 'model.dart'; +export 'model.dart'; class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ @@ -20,8 +21,8 @@ class CardItemTemplateComponentWidget extends StatefulWidget { }); final Map? labelsHashMap; - final Map? statusHashMap; - final Map imageHashMap; //document/vteID and type + final List?> statusHashMap; + final Map imageHashMap; final Future Function()? onTapCardItemAction; @override @@ -35,8 +36,8 @@ class _CardItemTemplateComponentWidgetState LinkedHashMap get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap ?? {}); - LinkedHashMap get statusLinkedHashMap => - LinkedHashMap.from(widget.statusHashMap ?? {}); + List> get statusLinkedHashMap => + widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); @override void setState(VoidCallback callback) { @@ -70,7 +71,8 @@ class _CardItemTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - log('imageHashMap: ${widget.imageHashMap}'); + + return InkWell( splashColor: Colors.transparent, @@ -178,36 +180,40 @@ class _CardItemTemplateComponentWidgetState }, ), ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.symmetric(vertical: 3.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: statusLinkedHashMap.values.first, - borderRadius: BorderRadius.circular(5.0), - ), - child: Align( - alignment: Alignment.center, - child: Text( - statusLinkedHashMap.keys - .first, // Acessa diretamente a chave como texto do status - style: TextStyle( - // Substitua por seu tema ou estilo de texto - color: FlutterFlowTheme.of(context) - .info, // Cor do texto, ajuste conforme necessário + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries.map((MapEntry item) { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 3.0), + child: Container( + width: 100.0, + height: 27.0, + decoration: BoxDecoration( + color: item.value, // Usa a cor do item atual + borderRadius: BorderRadius.circular(5.0), + ), + child: Align( + alignment: Alignment.center, + child: Text( + item.key, // Usa a chave do item atual como texto + style: TextStyle( + color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário + ), + ), + ), ), ), - ), + ], ), - ), - ], - ), + ); + }).toList(); + }).toList(), ), ]), ), diff --git a/lib/commons/components/molecules/header/index.dart b/lib/commons/components/molecules/header/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/index.dart b/lib/commons/components/molecules/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_item/index.dart b/lib/commons/components/molecules/menu_item/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_item/widget.dart b/lib/commons/components/molecules/menu_item/widget.dart new file mode 100644 index 00000000..458ff49a --- /dev/null +++ b/lib/commons/components/molecules/menu_item/widget.dart @@ -0,0 +1,11 @@ + +import 'package:flutter/cupertino.dart'; + +abstract class MenuEntry extends StatefulWidget { + const MenuEntry({ + Key? key, + }) : super(key: key); + + + +} \ No newline at end of file diff --git a/lib/commons/components/molecules/menu_list_view/index.dart b/lib/commons/components/molecules/menu_list_view/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart b/lib/commons/components/molecules/menu_list_view/model.dart similarity index 63% rename from lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart rename to lib/commons/components/molecules/menu_list_view/model.dart index 7ce9985b..945dd425 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart +++ b/lib/commons/components/molecules/menu_list_view/model.dart @@ -1,7 +1,9 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; + +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; +import 'widget.dart'; + class MenuListViewComponentModel extends FlutterFlowModel { @override diff --git a/lib/commons/components/molecules/menu_list_view/widget.dart b/lib/commons/components/molecules/menu_list_view/widget.dart new file mode 100644 index 00000000..481e0fbb --- /dev/null +++ b/lib/commons/components/molecules/menu_list_view/widget.dart @@ -0,0 +1,172 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; +import 'package:hub/commons/components/molecules/menu_item/widget.dart'; +import 'package:hub/commons/schema/enums/enums.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import 'model.dart'; + + +class MenuListViewComponentWidget extends StatefulWidget { + const MenuListViewComponentWidget({ + super.key, + required this.changeMenuStyle, + required this.registerVisitorOptAction, + required this.scheduleVisitOptAction, + required this.peopleOnThePropertyOptAction, + required this.preferencesSettings, + required this.liberationHistoryOptAction, + required this.accessQRCodeOptAction, + required this.expandable, + required this.item, + required this.options, + required this.messageHistoryAction, + }); + + final bool expandable; + final MenuItem item; + + final List options; + final Future Function()? changeMenuStyle; + final Future Function()? registerVisitorOptAction; + final Future Function()? scheduleVisitOptAction; + final Future Function()? peopleOnThePropertyOptAction; + final Future Function()? preferencesSettings; + final Future Function()? liberationHistoryOptAction; + final Future Function()? accessQRCodeOptAction; + final Future Function()? messageHistoryAction; + + @override + State createState() => + _MenuListViewComponentWidgetState(); +} + +class _MenuListViewComponentWidgetState + extends State { + late MenuListViewComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuListViewComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + buildMenuItem(context), + if (widget.expandable) + buildExpandableButton(context), + ], + ); + } + + Widget buildMenuItem(BuildContext context) { + switch(widget.item) { + case MenuItem.button: + return SizedBox( + height: 100, + width: double.infinity, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.horizontal, + + itemCount: widget.options.length, + itemBuilder: (context, index) { + return SizedBox( + height: 115, + width: 115, + child: widget.options[index]); + }, + ), + ); + case MenuItem.card: + return ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + itemCount: widget.options.length, + itemBuilder: (context, index) { + return MenuButtonWidget( + action: widget.registerVisitorOptAction, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, + ); + }, + ); + } +} + + Row buildExpandableButton(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + FFLocalizations.of(context).getVariableText( + enText: 'Expand', + ptText: 'Expandir', + ), + style: FlutterFlowTheme.of(context).title1.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 12.0, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 0.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_down_outlined, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ); + } +} diff --git a/lib/commons/components/molecules/menu_staggered_view/index.dart b/lib/commons/components/molecules/menu_staggered_view/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart b/lib/commons/components/molecules/menu_staggered_view/model.dart similarity index 62% rename from lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart rename to lib/commons/components/molecules/menu_staggered_view/model.dart index 8aebfc69..4124e85c 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart +++ b/lib/commons/components/molecules/menu_staggered_view/model.dart @@ -1,8 +1,10 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_widget.dart' - show MenuStaggeredViewComponentWidget; + +import '/commons/widgets/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; +import 'widget.dart'; + class MenuStaggeredViewComponentModel extends FlutterFlowModel { @override diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/commons/components/molecules/menu_staggered_view/widget.dart similarity index 99% rename from lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart rename to lib/commons/components/molecules/menu_staggered_view/widget.dart index 8e5441a3..c635435b 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/commons/components/molecules/menu_staggered_view/widget.dart @@ -4,12 +4,12 @@ import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_model.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import 'model.dart'; -export 'menu_staggered_view_component_model.dart'; +export 'model.dart'; class MenuStaggeredViewComponentWidget extends StatefulWidget { const MenuStaggeredViewComponentWidget({ diff --git a/lib/commons/components/molecules/message_well/index.dart b/lib/commons/components/molecules/message_well/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart b/lib/commons/components/molecules/message_well/model.dart similarity index 83% rename from lib/components/organism_components/message_well_component/message_well_component_model.dart rename to lib/commons/components/molecules/message_well/model.dart index 89ce0d76..3a1c4b48 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_model.dart +++ b/lib/commons/components/molecules/message_well/model.dart @@ -1,10 +1,11 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/widgets/request_manager.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'message_well_component_widget.dart' show MessageWellComponentWidget; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; +import 'widget.dart'; + class MessageWellComponentModel extends FlutterFlowModel { final unfocusNode = FocusNode(); diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/commons/components/molecules/message_well/widget.dart similarity index 97% rename from lib/components/organism_components/message_well_component/message_well_component_widget.dart rename to lib/commons/components/molecules/message_well/widget.dart index 1a82d88f..680f89cf 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ b/lib/commons/components/molecules/message_well/widget.dart @@ -2,10 +2,10 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'package:f_r_e_hub/app_state.dart'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/commons/components/molecules/well/index.dart b/lib/commons/components/molecules/well/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/organisms/index.dart b/lib/commons/components/organisms/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/organisms/menu/index.dart b/lib/commons/components/organisms/menu/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/commons/components/organisms/menu/model.dart similarity index 84% rename from lib/components/organism_components/menu_component/menu_component_model.dart rename to lib/commons/components/organisms/menu/model.dart index b6aa80df..ad111216 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/commons/components/organisms/menu/model.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:hub/commons/components/molecules/menu_list_view/model.dart'; +import 'package:hub/commons/components/molecules/menu_staggered_view/model.dart'; -import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; -import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_component_widget.dart' show MenuComponentWidget; +import 'package:hub/modals/filters/selections/widget.dart'; + + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show MenuComponentWidget; class MenuComponentModel extends FlutterFlowModel { /// Local state fields for this component. @@ -128,13 +130,13 @@ class MenuComponentModel extends FlutterFlowModel { 'liberationHistory', 'acessHistoryPage', 'scheduleCompleteVisitPage', - // 'messageHistoryPage', + 'messageHistoryPage' ], iconsListIcon: [ Icons.history_rounded, Icons.history_rounded, Icons.history_rounded, - // Icons.history_rounded, + Icons.history_rounded, ], nameListStr: [ FFLocalizations.of(context).getVariableText( @@ -149,10 +151,10 @@ class MenuComponentModel extends FlutterFlowModel { ptText: 'Histórico\nde Visita', enText: 'Visit\nHistory', ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Mensagens', + enText: 'Message\nHistory', + ), ], ), ); @@ -172,4 +174,19 @@ class MenuComponentModel extends FlutterFlowModel { }, ); } + + Future messageHistoryAction(BuildContext context) async { + context.pushNamed( + 'messageHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + } diff --git a/lib/commons/components/organisms/menu/widget.dart b/lib/commons/components/organisms/menu/widget.dart new file mode 100644 index 00000000..ddda55dc --- /dev/null +++ b/lib/commons/components/organisms/menu/widget.dart @@ -0,0 +1,217 @@ + + + + +import 'dart:developer'; + +import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; +import 'package:hub/commons/components/molecules/menu_item/widget.dart'; +import 'package:hub/commons/components/molecules/menu_list_view/widget.dart'; +import 'package:hub/commons/components/molecules/menu_staggered_view/widget.dart'; +import 'package:hub/commons/schema/enums/enums.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'model.dart'; +export 'model.dart'; + +class MenuComponentWidget extends StatefulWidget { + const MenuComponentWidget({ + Key? key, + required this.style, + required this.item, + required this.expandable, + required this.options, + }); + final MenuView style; + final MenuItem item; + final bool expandable; + final List options; + + @override + State createState() => _MenuComponentWidgetState(); +} + +class _MenuComponentWidgetState extends State { + late MenuComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + log('MenuComponentWidget: ${widget.options.toList().toString()}'); + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Builder( + builder: (context) { + if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: widget.options, + expandable: widget.expandable, + item: widget.item, + + + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + changeMenuStyleAction: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + ), + ); + } + } + if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + expandable: widget.expandable, + item: widget.item, + options: widget.options, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + + + ), + ); + } + return const SizedBox(); + }, + ), + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + +} diff --git a/lib/commons/components/templates/browser/index.dart b/lib/commons/components/templates/browser/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/consult/index.dart b/lib/commons/components/templates/consult/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/consult/model.dart b/lib/commons/components/templates/consult/model.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/consult/widget.dart b/lib/commons/components/templates/consult/widget.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/detail/index.dart b/lib/commons/components/templates/detail/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/exception/index.dart b/lib/commons/components/templates/exception/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart b/lib/commons/components/templates/exception/model.dart similarity index 64% rename from lib/components/molecular_components/throw_exception/throw_exception_model.dart rename to lib/commons/components/templates/exception/model.dart index 31b6cee7..b157c56b 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_model.dart +++ b/lib/commons/components/templates/exception/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'throw_exception_widget.dart' show ThrowExceptionWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ThrowExceptionWidget; import 'package:flutter/material.dart'; class ThrowExceptionModel extends FlutterFlowModel { diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/commons/components/templates/exception/widget.dart similarity index 96% rename from lib/components/molecular_components/throw_exception/throw_exception_widget.dart rename to lib/commons/components/templates/exception/widget.dart index a4c60fa7..d1476ef0 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/commons/components/templates/exception/widget.dart @@ -1,11 +1,11 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'throw_exception_model.dart'; -export 'throw_exception_model.dart'; +import 'model.dart'; +export 'model.dart'; class ThrowExceptionWidget extends StatefulWidget { const ThrowExceptionWidget({ diff --git a/lib/commons/components/templates/filter/index.dart b/lib/commons/components/templates/filter/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/forms/index.dart b/lib/commons/components/templates/forms/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/index.dart b/lib/commons/components/templates/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/notification/index.dart b/lib/commons/components/templates/notification/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/register/index.dart b/lib/commons/components/templates/register/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/register/mode.dart b/lib/commons/components/templates/register/mode.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/register/widget.dart b/lib/commons/components/templates/register/widget.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/schedule/index.dart b/lib/commons/components/templates/schedule/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/schedule/model.dart b/lib/commons/components/templates/schedule/model.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/schedule/widget.dart b/lib/commons/components/templates/schedule/widget.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/setting/index.dart b/lib/commons/components/templates/setting/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/setting/model.dart b/lib/commons/components/templates/setting/model.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/setting/widget.dart b/lib/commons/components/templates/setting/widget.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/welcome/index.dart b/lib/commons/components/templates/welcome/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/welcome/model.dart b/lib/commons/components/templates/welcome/model.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/welcome/widget.dart b/lib/commons/components/templates/welcome/widget.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/backend/schema/enums/enums.dart b/lib/commons/schema/enums/enums.dart similarity index 85% rename from lib/backend/schema/enums/enums.dart rename to lib/commons/schema/enums/enums.dart index cfef83fe..bb6ac511 100644 --- a/lib/backend/schema/enums/enums.dart +++ b/lib/commons/schema/enums/enums.dart @@ -5,6 +5,17 @@ enum AppHeaderComponent { home, } +enum MenuView { + list_grid, + list, + grid, +} + +enum MenuItem { + button, + card +} + extension FFEnumExtensions on T { String serialize() => name; } diff --git a/lib/commons/schema/enums/index.dart b/lib/commons/schema/enums/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/index.dart b/lib/commons/schema/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/backend/schema/structs/device_struct.dart b/lib/commons/schema/structs/device_struct.dart similarity index 96% rename from lib/backend/schema/structs/device_struct.dart rename to lib/commons/schema/structs/device_struct.dart index bf1d6bf9..6ffaeaae 100644 --- a/lib/backend/schema/structs/device_struct.dart +++ b/lib/commons/schema/structs/device_struct.dart @@ -1,9 +1,9 @@ // ignore_for_file: unnecessary_getters_setters -import '/backend/schema/util/schema_util.dart'; +import '/commons/schema/util/schema_util.dart'; import 'index.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_util.dart'; class DeviceStruct extends BaseStruct { DeviceStruct({ diff --git a/lib/commons/schema/structs/index.dart b/lib/commons/schema/structs/index.dart new file mode 100644 index 00000000..18bd18f3 --- /dev/null +++ b/lib/commons/schema/structs/index.dart @@ -0,0 +1,3 @@ +export '/commons/schema/util/schema_util.dart'; + +export 'device_struct.dart'; diff --git a/lib/commons/schema/util/index.dart b/lib/commons/schema/util/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/backend/schema/util/schema_util.dart b/lib/commons/schema/util/schema_util.dart similarity index 95% rename from lib/backend/schema/util/schema_util.dart rename to lib/commons/schema/util/schema_util.dart index f1ad8a3f..b788a544 100644 --- a/lib/backend/schema/util/schema_util.dart +++ b/lib/commons/schema/util/schema_util.dart @@ -3,8 +3,8 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:from_css_color/from_css_color.dart'; -import '/backend/schema/enums/enums.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/schema/enums/enums.dart'; +import '/commons/widgets/flutter_flow_util.dart'; export 'package:collection/collection.dart' show ListEquality; export 'package:flutter/material.dart' show Color, Colors; diff --git a/lib/commons/widgets/a11y/index.dart b/lib/commons/widgets/a11y/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/control/index.dart b/lib/commons/widgets/control/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/flutter_flow/custom_functions.dart b/lib/commons/widgets/custom_functions.dart similarity index 97% rename from lib/flutter_flow/custom_functions.dart rename to lib/commons/widgets/custom_functions.dart index 066402f2..1c663fdc 100644 --- a/lib/flutter_flow/custom_functions.dart +++ b/lib/commons/widgets/custom_functions.dart @@ -8,8 +8,8 @@ import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; +import '/commons/schema/structs/index.dart'; +import '/commons/schema/enums/enums.dart'; String? isOneAcliID(String jsonString) { // Converte o JSON em um Map diff --git a/lib/flutter_flow/custom_icons.dart b/lib/commons/widgets/custom_icons.dart similarity index 100% rename from lib/flutter_flow/custom_icons.dart rename to lib/commons/widgets/custom_icons.dart diff --git a/lib/flutter_flow/flutter_flow_animations.dart b/lib/commons/widgets/flutter_flow_animations.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_animations.dart rename to lib/commons/widgets/flutter_flow_animations.dart diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart b/lib/commons/widgets/flutter_flow_button_tabbar.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_button_tabbar.dart rename to lib/commons/widgets/flutter_flow_button_tabbar.dart diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart b/lib/commons/widgets/flutter_flow_checkbox_group.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_checkbox_group.dart rename to lib/commons/widgets/flutter_flow_checkbox_group.dart diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart b/lib/commons/widgets/flutter_flow_drop_down.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_drop_down.dart rename to lib/commons/widgets/flutter_flow_drop_down.dart diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart b/lib/commons/widgets/flutter_flow_icon_button.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_icon_button.dart rename to lib/commons/widgets/flutter_flow_icon_button.dart diff --git a/lib/flutter_flow/flutter_flow_model.dart b/lib/commons/widgets/flutter_flow_model.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_model.dart rename to lib/commons/widgets/flutter_flow_model.dart diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/commons/widgets/flutter_flow_theme.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_theme.dart rename to lib/commons/widgets/flutter_flow_theme.dart diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/commons/widgets/flutter_flow_util.dart similarity index 99% rename from lib/flutter_flow/flutter_flow_util.dart rename to lib/commons/widgets/flutter_flow_util.dart index 8bdcf64e..3d793c08 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/commons/widgets/flutter_flow_util.dart @@ -11,14 +11,14 @@ import 'package:json_path/json_path.dart'; import 'package:timeago/timeago.dart' as timeago; import 'package:url_launcher/url_launcher.dart'; -import '../main.dart'; +import '/main.dart'; export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; export 'place.dart'; export 'uploaded_file.dart'; -export '../app_state.dart'; +export '/app_state.dart'; export 'flutter_flow_model.dart'; export 'dart:math' show min, max; export 'dart:typed_data' show Uint8List; @@ -27,7 +27,7 @@ export 'package:intl/intl.dart'; export 'package:page_transition/page_transition.dart'; export 'custom_icons.dart' show FFIcons; export 'internationalization.dart' show FFLocalizations; -export 'nav/nav.dart'; +export 'package:hub/commons/actions/nav.dart'; T valueOrDefault(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value; diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/commons/widgets/flutter_flow_widgets.dart similarity index 100% rename from lib/flutter_flow/flutter_flow_widgets.dart rename to lib/commons/widgets/flutter_flow_widgets.dart diff --git a/lib/flutter_flow/form_field_controller.dart b/lib/commons/widgets/form_field_controller.dart similarity index 100% rename from lib/flutter_flow/form_field_controller.dart rename to lib/commons/widgets/form_field_controller.dart diff --git a/lib/commons/widgets/image_cropper.dart b/lib/commons/widgets/image_cropper.dart new file mode 100644 index 00000000..242d059a --- /dev/null +++ b/lib/commons/widgets/image_cropper.dart @@ -0,0 +1,179 @@ +// // Automatic FlutterFlow imports +// import '/commons/schema/structs/index.dart'; +// import '/commons/schema/enums/enums.dart'; +// import '/actions/actions.dart' as action_blocks; +// import '/flutter_flow/flutter_flow_theme.dart'; +// import '/flutter_flow/flutter_flow_util.dart'; +// import 'index.dart'; // Imports other custom widgets +// import '/custom_code/actions/index.dart'; // Imports custom actions +// import '/flutter_flow/custom_functions.dart'; // Imports custom functions +// import 'package:flutter/material.dart'; +// // Begin custom widget code +// // DO NOT REMOVE OR MODIFY THE CODE ABOVE! + +// import 'package:crop_your_image/crop_your_image.dart'; +// import 'package:google_fonts/google_fonts.dart'; +// import '/commons/firebase_storage/storage.dart'; + +// class ImageCropper extends StatefulWidget { +// const ImageCropper({ +// super.key, +// this.width, +// this.height, +// this.imageFile, +// this.callBackAction, +// this.currentUserId, +// }); + +// final double? width; +// final double? height; +// final FFUploadedFile? imageFile; +// final Future Function(String? url)? callBackAction; +// final String? currentUserId; + +// @override +// State createState() => _ImageCropperState(); +// } + +// class _ImageCropperState extends State { +// bool loading = false; +// final _crop_controller = CropController(); +// @override +// Widget build(BuildContext context) { +// return Stack( +// children: [ +// Column( +// mainAxisSize: MainAxisSize.min, +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Container( +// width: widget.width ?? double.infinity, +// height: (widget.height ?? 555) - 80, +// child: Center( +// child: Crop( +// image: Uint8List.fromList(widget.imageFile!.bytes!), +// controller: _crop_controller, +// onCropped: (image) async { +// final path = _getStoragePath(_firebasePathPrefix(), +// widget.imageFile!.name!, false, 0); +// uploadData(path, image).then((value) { +// log('image cropped'); +// widget.callBackAction!.call(value!); +// loading = false; +// }); +// // add error handling here +// }, + +// aspectRatio: 1 / 1, +// initialSize: 0.5, +// // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ +// //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), +// withCircleUi: true, +// baseColor: Color.fromARGB(255, 0, 3, 22), +// maskColor: Colors.white.withAlpha(100), +// radius: 20, + +// onMoved: (newRect) { +// // do something with current cropping area. +// }, +// onStatusChanged: (status) { +// // do something with current CropStatus +// }, +// cornerDotBuilder: (size, edgeAlignment) => +// const DotControl(color: Colors.white), +// interactive: true, +// // fixArea: true, +// ))), +// Padding( +// padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), +// child: ElevatedButton( +// onPressed: () async { +// if (!loading) { +// setState(() { +// loading = true; +// }); +// log('Button pressed ...'); +// _crop_controller.crop(); + +// //widget.loading = true; +// } +// }, +// style: ButtonStyle( +// backgroundColor: MaterialStateProperty.all( +// FlutterFlowTheme.of(context).primaryColor, +// ), +// padding: MaterialStateProperty.all( +// EdgeInsets.zero, +// ), +// shape: MaterialStateProperty.all( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(100), +// side: BorderSide.none, +// ), +// ), +// ), +// child: Container( +// width: 250, +// height: 50, +// alignment: Alignment.center, +// child: loading +// ? CircularProgressIndicator( +// valueColor: +// AlwaysStoppedAnimation(Colors.white), +// ) +// : Text( +// 'Crop', +// style: FlutterFlowTheme.of(context) +// .subtitle2 +// .override( +// fontFamily: 'Lexend', +// color: Colors.white, +// fontSize: 16, +// fontWeight: FontWeight.normal, +// useGoogleFonts: GoogleFonts.asMap() +// .containsKey( +// FlutterFlowTheme.of(context) +// .subtitle2Family), +// ), +// ), +// ), +// )), +// ]), +// Positioned( +// top: 4, +// right: 4, +// child: IconButton( +// icon: Icon(Icons.close), +// onPressed: () => Navigator.pop(context), +// )) +// ], +// ); +// } + +// String _getStoragePath( +// String? pathPrefix, +// String filePath, +// bool isVideo, [ +// int? index, +// ]) { +// pathPrefix ??= _firebasePathPrefix(); +// pathPrefix = _removeTrailingSlash(pathPrefix); +// final timestamp = DateTime.now().microsecondsSinceEpoch; +// final prefix = 'cropped-'; +// // Workaround fixed by https://github.com/flutter/plugins/pull/3685 +// // (not yet in stable). +// final ext = isVideo ? 'mp4' : filePath.split('.').last; +// final indexStr = index != null ? '_$index' : ''; +// return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; +// } + +// String? _removeTrailingSlash(String? path) => +// path != null && path.endsWith('/') +// ? path.substring(0, path.length - 1) +// : path; + +// String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; +// } +// // Set your widget name, define your parameter, and then add the +// // boilerplate code using the green button on the right! diff --git a/lib/custom_code/widgets/index.dart b/lib/commons/widgets/index.dart similarity index 100% rename from lib/custom_code/widgets/index.dart rename to lib/commons/widgets/index.dart diff --git a/lib/commons/widgets/info/index.dart b/lib/commons/widgets/info/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/flutter_flow/internationalization.dart b/lib/commons/widgets/internationalization.dart similarity index 100% rename from lib/flutter_flow/internationalization.dart rename to lib/commons/widgets/internationalization.dart diff --git a/lib/commons/widgets/io/index.dart b/lib/commons/widgets/io/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/io/textfield/index.dart b/lib/commons/widgets/io/textfield/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart b/lib/commons/widgets/io/textfield/model.dart similarity index 81% rename from lib/components/atomic_components/text_field_component/text_field_component_model.dart rename to lib/commons/widgets/io/textfield/model.dart index 30f54431..a9b24925 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_model.dart +++ b/lib/commons/widgets/io/textfield/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'text_field_component_widget.dart' show TextFieldComponentWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; class TextFieldComponentModel diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart b/lib/commons/widgets/io/textfield/widget.dart similarity index 95% rename from lib/components/atomic_components/text_field_component/text_field_component_widget.dart rename to lib/commons/widgets/io/textfield/widget.dart index e9ab116f..0877f481 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart +++ b/lib/commons/widgets/io/textfield/widget.dart @@ -1,9 +1,9 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'text_field_component_model.dart'; -export 'text_field_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class TextFieldComponentWidget extends StatefulWidget { const TextFieldComponentWidget({ diff --git a/lib/flutter_flow/keep_alive_wrapper.dart b/lib/commons/widgets/keep_alive_wrapper.dart similarity index 100% rename from lib/flutter_flow/keep_alive_wrapper.dart rename to lib/commons/widgets/keep_alive_wrapper.dart diff --git a/lib/flutter_flow/lat_lng.dart b/lib/commons/widgets/lat_lng.dart similarity index 100% rename from lib/flutter_flow/lat_lng.dart rename to lib/commons/widgets/lat_lng.dart diff --git a/lib/commons/widgets/layout/index.dart b/lib/commons/widgets/layout/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/menu.dart b/lib/commons/widgets/menu.dart new file mode 100644 index 00000000..b3fa00c7 --- /dev/null +++ b/lib/commons/widgets/menu.dart @@ -0,0 +1,61 @@ + +import 'dart:collection'; + +import 'package:flutter/material.dart'; + +LinkedHashMap menu = LinkedHashMap.from({ + "Schedule": + [{ + "title": "Schedule\nVisit", + "icon": Icons.settings, + "route": "/Schedule", + }, + { + "title": "Complete\Schedule", + "icon": Icons.calendar_today, + "route": "/Complete", + }, + { + "title": "Provisional\Schedule", + "icon": Icons.calendar_today, + "route": "/Provisional", + }, + { + "title": "Fast\Schedule", + "icon": Icons.calendar_today, + "route": "/Fast", + }], + "Consult": + [{ + "title": "Consult", + "icon": Icons.search, + "route": "/consult", + }, + { + "title": "Liberation\nConsult", + "icon": Icons.search, + "route": "/Liberation", + }, + { + "title": "Access\nConsult", + "icon": Icons.search, + "route": "/Access", + }, + { + "title": "Poeple\nConsult", + "icon": Icons.search, + "route": "/Poeple", + }, + { + "title": "QR Code\nConsult", + "icon": Icons.search, + "route": "/qrcode", + }], + "Preferences": + [{ + "title": "Preferences", + "icon": Icons.settings, + "route": "/preferences", + }], + +}); \ No newline at end of file diff --git a/lib/commons/widgets/nav/index.dart b/lib/commons/widgets/nav/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/flutter_flow/permissions_util.dart b/lib/commons/widgets/permissions_util.dart similarity index 100% rename from lib/flutter_flow/permissions_util.dart rename to lib/commons/widgets/permissions_util.dart diff --git a/lib/flutter_flow/place.dart b/lib/commons/widgets/place.dart similarity index 100% rename from lib/flutter_flow/place.dart rename to lib/commons/widgets/place.dart diff --git a/lib/flutter_flow/random_data_util.dart b/lib/commons/widgets/random_data_util.dart similarity index 100% rename from lib/flutter_flow/random_data_util.dart rename to lib/commons/widgets/random_data_util.dart diff --git a/lib/flutter_flow/request_manager.dart b/lib/commons/widgets/request_manager.dart similarity index 100% rename from lib/flutter_flow/request_manager.dart rename to lib/commons/widgets/request_manager.dart diff --git a/lib/commons/widgets/scroll/index.dart b/lib/commons/widgets/scroll/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/style/index.dart b/lib/commons/widgets/style/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/flutter_flow/upload_data.dart b/lib/commons/widgets/upload_data.dart similarity index 100% rename from lib/flutter_flow/upload_data.dart rename to lib/commons/widgets/upload_data.dart diff --git a/lib/flutter_flow/uploaded_file.dart b/lib/commons/widgets/uploaded_file.dart similarity index 100% rename from lib/flutter_flow/uploaded_file.dart rename to lib/commons/widgets/uploaded_file.dart diff --git a/lib/commons/widgets/view/index.dart b/lib/commons/widgets/view/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart deleted file mode 100644 index 20fca7e9..00000000 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ /dev/null @@ -1,135 +0,0 @@ -import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'menu_component_model.dart'; -export 'menu_component_model.dart'; - -class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({super.key}); - - @override - State createState() => _MenuComponentWidgetState(); -} - -class _MenuComponentWidgetState extends State { - late MenuComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Builder( - builder: (context) { - if (_model.isGrid == true) { - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } - }, - ), - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - -} diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart deleted file mode 100644 index 06154b38..00000000 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ /dev/null @@ -1,1027 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:google_fonts/google_fonts.dart'; - -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_list_view_component_model.dart'; - -export 'menu_list_view_component_model.dart'; - -class MenuListViewComponentWidget extends StatefulWidget { - const MenuListViewComponentWidget({ - super.key, - required this.changeMenuStyle, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, - }); - - final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - - @override - State createState() => - _MenuListViewComponentWidgetState(); -} - -class _MenuListViewComponentWidgetState - extends State { - late MenuListViewComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuListViewComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), - child: Container( - width: double.infinity, - height: 125.0, - decoration: const BoxDecoration(), - child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), - scrollDirection: Axis.horizontal, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'utgue9a5' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '82b5f8yz' /* Cadastrar -Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.khome, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 't4ie13ut' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'n3n76pha' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'l6b9o7yn' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rxnrtdau' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - ptText: 'Consultar\nConsultar', - enText: 'Consult\nHistories', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.settings, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Preferences\nSystem', - ptText: 'Preferências\ndo Sistema', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - - ].divide(const SizedBox(width: 15.0)), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - FFLocalizations.of(context).getVariableText( - enText: 'Expand', - ptText: 'Expandir', - ), - style: FlutterFlowTheme.of(context).title1.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 12.0, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.normal, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 0.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_down_outlined, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyle?.call(); - }, - ), - ), - ], - ), - ], - ); - } -} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart deleted file mode 100644 index a779051b..00000000 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ /dev/null @@ -1,57 +0,0 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'regisiter_vistor_template_component_widget.dart' - show RegisiterVistorTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class RegisiterVistorTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? registerVisitor; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart deleted file mode 100644 index 5c89397f..00000000 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart +++ /dev/null @@ -1,59 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_in_template_component_widget.dart' - show SignInTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class SignInTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - String? _emailAddressTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'xhnawzcb' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - String? _passwordTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '9cs5wlmc' /* Campo é necessário */, - ); - } - - return null; - } - - @override - void initState(BuildContext context) { - emailAddressTextControllerValidator = _emailAddressTextControllerValidator; - passwordVisibility = false; - passwordTextControllerValidator = _passwordTextControllerValidator; - } - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); - } -} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart deleted file mode 100644 index bbcd4725..00000000 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart +++ /dev/null @@ -1,91 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_up_template_component_widget.dart' - show SignUpTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class SignUpTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '3bs10dfq' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } - return null; - } - - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - String? _emailRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'mlvw63yj' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '6nn79lmh' /* Campo é necessário */, - ); - } - - return null; - } - - // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. - bool? signUp; - - @override - void initState(BuildContext context) { - nameRegisterFormTextControllerValidator = - _nameRegisterFormTextControllerValidator; - emailRegisterFormTextControllerValidator = - _emailRegisterFormTextControllerValidator; - passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = - _passwordRegisterFormTextControllerValidator; - } - - @override - void dispose() { - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); - } -} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart deleted file mode 100644 index 17ea3047..00000000 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart +++ /dev/null @@ -1,13 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'welcome_template_component_widget.dart' - show WelcomeTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class WelcomeTemplateComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/custom_code/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart deleted file mode 100644 index da1dbe23..00000000 --- a/lib/custom_code/widgets/image_cropper.dart +++ /dev/null @@ -1,179 +0,0 @@ -// Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'index.dart'; // Imports other custom widgets -import '/custom_code/actions/index.dart'; // Imports custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom widget code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! - -import 'package:crop_your_image/crop_your_image.dart'; -import 'package:google_fonts/google_fonts.dart'; -import '/backend/firebase_storage/storage.dart'; - -class ImageCropper extends StatefulWidget { - const ImageCropper({ - super.key, - this.width, - this.height, - this.imageFile, - this.callBackAction, - this.currentUserId, - }); - - final double? width; - final double? height; - final FFUploadedFile? imageFile; - final Future Function(String? url)? callBackAction; - final String? currentUserId; - - @override - State createState() => _ImageCropperState(); -} - -class _ImageCropperState extends State { - bool loading = false; - final _crop_controller = CropController(); - @override - Widget build(BuildContext context) { - return Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: widget.width ?? double.infinity, - height: (widget.height ?? 555) - 80, - child: Center( - child: Crop( - image: Uint8List.fromList(widget.imageFile!.bytes!), - controller: _crop_controller, - onCropped: (image) async { - final path = _getStoragePath(_firebasePathPrefix(), - widget.imageFile!.name!, false, 0); - uploadData(path, image).then((value) { - log('image cropped'); - widget.callBackAction!.call(value!); - loading = false; - }); - // add error handling here - }, - - aspectRatio: 1 / 1, - initialSize: 0.5, - // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ - //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), - withCircleUi: true, - baseColor: Color.fromARGB(255, 0, 3, 22), - maskColor: Colors.white.withAlpha(100), - radius: 20, - - onMoved: (newRect) { - // do something with current cropping area. - }, - onStatusChanged: (status) { - // do something with current CropStatus - }, - cornerDotBuilder: (size, edgeAlignment) => - const DotControl(color: Colors.white), - interactive: true, - // fixArea: true, - ))), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), - child: ElevatedButton( - onPressed: () async { - if (!loading) { - setState(() { - loading = true; - }); - log('Button pressed ...'); - _crop_controller.crop(); - - //widget.loading = true; - } - }, - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - FlutterFlowTheme.of(context).primaryColor, - ), - padding: MaterialStateProperty.all( - EdgeInsets.zero, - ), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(100), - side: BorderSide.none, - ), - ), - ), - child: Container( - width: 250, - height: 50, - alignment: Alignment.center, - child: loading - ? CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation(Colors.white), - ) - : Text( - 'Crop', - style: FlutterFlowTheme.of(context) - .subtitle2 - .override( - fontFamily: 'Lexend', - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .subtitle2Family), - ), - ), - ), - )), - ]), - Positioned( - top: 4, - right: 4, - child: IconButton( - icon: Icon(Icons.close), - onPressed: () => Navigator.pop(context), - )) - ], - ); - } - - String _getStoragePath( - String? pathPrefix, - String filePath, - bool isVideo, [ - int? index, - ]) { - pathPrefix ??= _firebasePathPrefix(); - pathPrefix = _removeTrailingSlash(pathPrefix); - final timestamp = DateTime.now().microsecondsSinceEpoch; - final prefix = 'cropped-'; - // Workaround fixed by https://github.com/flutter/plugins/pull/3685 - // (not yet in stable). - final ext = isVideo ? 'mp4' : filePath.split('.').last; - final indexStr = index != null ? '_$index' : ''; - return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; - } - - String? _removeTrailingSlash(String? path) => - path != null && path.endsWith('/') - ? path.substring(0, path.length - 1) - : path; - - String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; -} -// Set your widget name, define your parameter, and then add the -// boilerplate code using the green button on the right! diff --git a/lib/index.dart b/lib/index.dart index 69f127d0..461cd5e3 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -1,26 +1,27 @@ -export '/pages/home_page/home_page_widget.dart' show HomePageWidget; -export '/pages/register_visitor_page/register_visitor_page_widget.dart' - show RegisterVisitorPageWidget; -export '/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart' - show ScheduleCompleteVisitPageWidget; +export 'pages/index.dart'; -export '/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart' - show ScheduleProvisionalVisitPageWidget; +// // CONSULT +// export 'pages/consults/access/' show AcessHistoryPageModel; +// export 'pages/consult/liberation/liberation_history_widget.dart' show LiberationHistoryWidget; +// export 'pages/consult/people/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget; +// export 'pages/consult/qrcode/qr_code_page_widget.dart' show QrCodePageWidget; +// export 'pages/consult/message/message_history_page_widget.dart' show MessageHistoryPageWidget; +// export 'pages/consult/visit/visit_history_page_widget.dart' show VisitHistoryPageWidget; +// /// HOME +// export 'pages/home/home_page_widget.dart' show HomePageWidget; +// /// REGISTER +// export 'pages/register/visitor/register_visitor_page_widget.dart' show RegisterVisitorPageWidget; +// /// SCHEDULE +// export 'pages/schedule/visit/complete/schedule_complete_visit_page_widget.dart' show ScheduleCompleteVisitPageWidget; +// export 'pages/schedule/visit/provisional/schedule_provisional_visit_page_widget.dart' show ScheduleProvisionalVisitPageWidget; +// export 'pages/schedule/visit/fastpass/fast_pass_page_widget.dart' show FastPassPageWidget; +// /// SETTINGS +// export 'pages/settings/preferences_settings_widget.dart' show PreferencesSettingsWidget; +// /// WELCOME +// export 'pages/welcome/welcome_page_widget.dart' show WelcomePageWidget; +// export 'pages/welcome/signin/sign_in_page_widget.dart' show SignInPageWidget; +// export 'pages/welcome/signup/sign_up_page_widget.dart' show SignUpPageWidget; -export '/pages/people_on_the_property_page/people_on_the_property_page_widget.dart' - show PeopleOnThePropertyPageWidget; -export '/pages/acess_history_page/acess_history_page_widget.dart' - show AcessHistoryPageWidget; - -export '/pages/liberation_history/liberation_history_widget.dart' - show LiberationHistoryWidget; - -export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget; - -export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; - -export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; -export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; diff --git a/lib/main.dart b/lib/main.dart index 9bc5efc1..19cd912a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,9 +6,9 @@ import 'package:responsive_framework/responsive_framework.dart'; import 'firebase_options.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; -import 'flutter_flow/flutter_flow_theme.dart'; -import 'flutter_flow/flutter_flow_util.dart'; -import 'flutter_flow/internationalization.dart'; +import 'commons/widgets/flutter_flow_theme.dart'; +import 'commons/widgets/flutter_flow_util.dart'; +import 'commons/widgets/internationalization.dart'; final GlobalKey navigatorKey = GlobalKey(); diff --git a/lib/modals/browsers/index.dart b/lib/modals/browsers/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/browsers/visitor_browser/index.dart b/lib/modals/browsers/visitor_browser/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart b/lib/modals/browsers/visitor_browser/model.dart similarity index 91% rename from lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart rename to lib/modals/browsers/visitor_browser/model.dart index 63da16d2..dff255f2 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart +++ b/lib/modals/browsers/visitor_browser/model.dart @@ -1,6 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_search_modal_template_component_widget.dart' +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show VisitorSearchModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/modals/browsers/visitor_browser/widget.dart similarity index 97% rename from lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart rename to lib/modals/browsers/visitor_browser/widget.dart index f393b4ec..926c3f6e 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/modals/browsers/visitor_browser/widget.dart @@ -1,16 +1,18 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/modals/details/visitor_details_modal/widget.dart'; +import 'package:hub/modals/exceptions/not_found/widget.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'visitor_search_modal_template_component_model.dart'; -export 'visitor_search_modal_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { const VisitorSearchModalTemplateComponentWidget({ diff --git a/lib/modals/details/index.dart b/lib/modals/details/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/liberation_history_item_details/index.dart b/lib/modals/details/liberation_history_item_details/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/modals/details/liberation_history_item_details/model.dart similarity index 92% rename from lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart rename to lib/modals/details/liberation_history_item_details/model.dart index 009f0a84..a53352d9 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart +++ b/lib/modals/details/liberation_history_item_details/model.dart @@ -1,6 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'liberation_history_item_details_template_component_widget.dart' +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show LiberationHistoryItemDetailsTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/modals/details/liberation_history_item_details/widget.dart similarity index 98% rename from lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart rename to lib/modals/details/liberation_history_item_details/widget.dart index bf7b6a1b..0c9b872f 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart +++ b/lib/modals/details/liberation_history_item_details/widget.dart @@ -1,11 +1,11 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_item_details_template_component_model.dart'; -export 'liberation_history_item_details_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { diff --git a/lib/modals/details/schedule_visit_detail/index.dart b/lib/modals/details/schedule_visit_detail/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/modals/details/schedule_visit_detail/model.dart similarity index 92% rename from lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart rename to lib/modals/details/schedule_visit_detail/model.dart index d30b8442..53c511e1 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/modals/details/schedule_visit_detail/model.dart @@ -1,6 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_visit_detail_widget.dart' show ScheduleVisitDetailWidget; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ScheduleVisitDetailWidget; import 'package:flutter/material.dart'; class ScheduleVisitDetailModel diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/modals/details/schedule_visit_detail/widget.dart similarity index 98% rename from lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart rename to lib/modals/details/schedule_visit_detail/widget.dart index 9641ca52..60bd9005 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/modals/details/schedule_visit_detail/widget.dart @@ -1,16 +1,17 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/modals/details/visitor_details_modal/widget.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'schedule_visit_detail_model.dart'; -export 'schedule_visit_detail_model.dart'; +import 'model.dart'; +export 'model.dart'; class ScheduleVisitDetailWidget extends StatefulWidget { const ScheduleVisitDetailWidget({ diff --git a/lib/modals/details/view_visit_detail/index.dart b/lib/modals/details/view_visit_detail/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/view_visit_detail/view_visit_detail_model.dart b/lib/modals/details/view_visit_detail/model.dart similarity index 92% rename from lib/components/view_visit_detail/view_visit_detail_model.dart rename to lib/modals/details/view_visit_detail/model.dart index a5726bc8..fcb9ff02 100644 --- a/lib/components/view_visit_detail/view_visit_detail_model.dart +++ b/lib/modals/details/view_visit_detail/model.dart @@ -1,6 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ViewVisitDetailWidget; import 'package:flutter/material.dart'; class ViewVisitDetailModel extends FlutterFlowModel { diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/modals/details/view_visit_detail/widget.dart similarity index 98% rename from lib/components/view_visit_detail/view_visit_detail_widget.dart rename to lib/modals/details/view_visit_detail/widget.dart index e5c4195f..dd308931 100644 --- a/lib/components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/modals/details/view_visit_detail/widget.dart @@ -1,21 +1,23 @@ import 'dart:convert'; import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; + +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/modals/details/visitor_details_modal/widget.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:share_plus/share_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'view_visit_detail_model.dart'; -export 'view_visit_detail_model.dart'; +import 'model.dart'; +export 'model.dart'; class ViewVisitDetailWidget extends StatefulWidget { const ViewVisitDetailWidget({ diff --git a/lib/modals/details/visit_details_modal/index.dart b/lib/modals/details/visit_details_modal/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/modals/details/visit_details_modal/model.dart similarity index 77% rename from lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart rename to lib/modals/details/visit_details_modal/model.dart index f305c4de..9fdddf3d 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/modals/details/visit_details_modal/model.dart @@ -1,7 +1,10 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_details_modal_template_component_widget.dart' + + +import 'package:hub/modals/details/schedule_visit_detail/model.dart'; +import 'package:hub/modals/details/view_visit_detail/model.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show VisitDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/modals/details/visit_details_modal/widget.dart similarity index 91% rename from lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart rename to lib/modals/details/visit_details_modal/widget.dart index e5aba602..2d468235 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/modals/details/visit_details_modal/widget.dart @@ -1,9 +1,12 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + + +import 'package:hub/modals/details/schedule_visit_detail/widget.dart'; +import 'package:hub/modals/details/view_visit_detail/widget.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'visit_details_modal_template_component_model.dart'; -export 'visit_details_modal_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { const VisitDetailsModalTemplateComponentWidget({ diff --git a/lib/modals/details/visitor_details_modal/index.dart b/lib/modals/details/visitor_details_modal/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart b/lib/modals/details/visitor_details_modal/model.dart similarity index 73% rename from lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart rename to lib/modals/details/visitor_details_modal/model.dart index d0f79706..a28e1ad4 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart +++ b/lib/modals/details/visitor_details_modal/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_details_modal_template_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show VisitorDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/modals/details/visitor_details_modal/widget.dart similarity index 98% rename from lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart rename to lib/modals/details/visitor_details_modal/widget.dart index 5f29a6fe..a52cc175 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart +++ b/lib/modals/details/visitor_details_modal/widget.dart @@ -1,9 +1,9 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'visitor_details_modal_template_component_model.dart'; -export 'visitor_details_modal_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { const VisitorDetailsModalTemplateComponentWidget({super.key}); diff --git a/lib/modals/exceptions/error/index.dart b/lib/modals/exceptions/error/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/exceptions/index.dart b/lib/modals/exceptions/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/exceptions/info/index.dart b/lib/modals/exceptions/info/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/exceptions/not_found/index.dart b/lib/modals/exceptions/not_found/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/modals/exceptions/not_found/model.dart similarity index 73% rename from lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart rename to lib/modals/exceptions/not_found/model.dart index f89f479d..3c858af5 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart +++ b/lib/modals/exceptions/not_found/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_not_found_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show VisitorNotFoundComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/modals/exceptions/not_found/widget.dart similarity index 93% rename from lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart rename to lib/modals/exceptions/not_found/widget.dart index 115a6304..2a86f8bb 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/modals/exceptions/not_found/widget.dart @@ -1,12 +1,14 @@ -import '/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/pages/registers/visitor/component.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'visitor_not_found_component_model.dart'; -export 'visitor_not_found_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({super.key}); diff --git a/lib/modals/exceptions/warning/index.dart b/lib/modals/exceptions/warning/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/access_filter/index.dart b/lib/modals/filters/access_filter/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart b/lib/modals/filters/access_filter/model.dart similarity index 86% rename from lib/components/molecular_components/message_opt_modal/opt_modal_model.dart rename to lib/modals/filters/access_filter/model.dart index 51674c2a..4a3c32d4 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart +++ b/lib/modals/filters/access_filter/model.dart @@ -1,6 +1,6 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'opt_modal_widget.dart' show OptModalWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/form_field_controller.dart'; +import 'widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; class OptModalModel extends FlutterFlowModel { diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/modals/filters/access_filter/widget.dart similarity index 98% rename from lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart rename to lib/modals/filters/access_filter/widget.dart index 551004ef..d0dab29d 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/modals/filters/access_filter/widget.dart @@ -1,8 +1,9 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/modals/filters/options/model.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; diff --git a/lib/modals/filters/options/index.dart b/lib/modals/filters/options/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart b/lib/modals/filters/options/model.dart similarity index 86% rename from lib/components/molecular_components/opt_modal/opt_modal_model.dart rename to lib/modals/filters/options/model.dart index 51674c2a..4a3c32d4 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_model.dart +++ b/lib/modals/filters/options/model.dart @@ -1,6 +1,6 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'opt_modal_widget.dart' show OptModalWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/form_field_controller.dart'; +import 'widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; class OptModalModel extends FlutterFlowModel { diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart b/lib/modals/filters/options/widget.dart similarity index 98% rename from lib/components/molecular_components/opt_modal/opt_modal_widget.dart rename to lib/modals/filters/options/widget.dart index 551004ef..d0dab29d 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/modals/filters/options/widget.dart @@ -1,8 +1,9 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/modals/filters/options/model.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; diff --git a/lib/modals/filters/selections/index.dart b/lib/modals/filters/selections/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart b/lib/modals/filters/selections/model.dart similarity index 64% rename from lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart rename to lib/modals/filters/selections/model.dart index d9448232..10acb96b 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart +++ b/lib/modals/filters/selections/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_widget.dart' show OptionSelectionModalWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show OptionSelectionModalWidget; import 'package:flutter/material.dart'; class OptionSelectionModalModel diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/modals/filters/selections/widget.dart similarity index 96% rename from lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart rename to lib/modals/filters/selections/widget.dart index ef4993fe..74a8c39b 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart +++ b/lib/modals/filters/selections/widget.dart @@ -1,14 +1,13 @@ -// import 'package:f_r_e_hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +// import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_model.dart'; - -export 'option_selection_modal_model.dart'; +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import 'model.dart'; +export 'model.dart'; class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ diff --git a/lib/modals/forms/change_password/index.dart b/lib/modals/forms/change_password/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart b/lib/modals/forms/change_password/model.dart similarity index 94% rename from lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart rename to lib/modals/forms/change_password/model.dart index c2febab7..b2927743 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart +++ b/lib/modals/forms/change_password/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'change_pass_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show PassKeyTemplateWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart b/lib/modals/forms/change_password/widget.dart similarity index 98% rename from lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart rename to lib/modals/forms/change_password/widget.dart index 5c19dfb3..a53a1545 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart +++ b/lib/modals/forms/change_password/widget.dart @@ -1,12 +1,12 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'change_pass_model.dart'; -export 'change_pass_model.dart'; +import 'model.dart'; +export 'model.dart'; class PassKeyTemplateWidget extends StatefulWidget { const PassKeyTemplateWidget({ @@ -126,7 +126,7 @@ class _PassKeyTemplateWidgetState child: Text( FFLocalizations.of(context).getVariableText( enText: 'INSERT PASSWORD', - ptText: 'ADICIONAR SENHA', + ptText: FFAppState().accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', diff --git a/lib/modals/forms/forgot_password/index.dart b/lib/modals/forms/forgot_password/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/modals/forms/forgot_password/model.dart similarity index 83% rename from lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart rename to lib/modals/forms/forgot_password/model.dart index 4178de7c..b1d69f20 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/modals/forms/forgot_password/model.dart @@ -1,6 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'forgot_password_template_component_widget.dart' + +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ForgotPasswordTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/modals/forms/forgot_password/widget.dart similarity index 97% rename from lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart rename to lib/modals/forms/forgot_password/widget.dart index 39cce295..b5bbc5b7 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/modals/forms/forgot_password/widget.dart @@ -1,12 +1,12 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'forgot_password_template_component_model.dart'; -export 'forgot_password_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class ForgotPasswordTemplateComponentWidget extends StatefulWidget { const ForgotPasswordTemplateComponentWidget({super.key}); diff --git a/lib/modals/forms/index.dart b/lib/modals/forms/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/qr_code/index.dart b/lib/modals/forms/qr_code/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart b/lib/modals/forms/qr_code/model.dart similarity index 91% rename from lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart rename to lib/modals/forms/qr_code/model.dart index 4e3f3260..1c41f39a 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart +++ b/lib/modals/forms/qr_code/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'qr_code_pass_key_template_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show QrCodePassKeyTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/modals/forms/qr_code/widget.dart similarity index 97% rename from lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart rename to lib/modals/forms/qr_code/widget.dart index c2d27cca..0bf75907 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/modals/forms/qr_code/widget.dart @@ -1,12 +1,12 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'qr_code_pass_key_template_component_model.dart'; -export 'qr_code_pass_key_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ @@ -38,7 +38,7 @@ class _QrCodePassKeyTemplateComponentWidgetState _model.keyTextFieldTextController ??= TextEditingController(); _model.keyTextFieldFocusNode ??= FocusNode(); - _model.keyTextFieldFocusNode!.addListener(() => setState(() {})); + _model.keyTextFieldFocusNode!.addListener(() => safeSetState(() {})); } @override @@ -168,7 +168,7 @@ class _QrCodePassKeyTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.keyTextFieldTextController', const Duration(milliseconds: 2000), - () => setState(() {}), + () => safeSetState(() {}), ), autofillHints: const [AutofillHints.password], textCapitalization: TextCapitalization.none, @@ -235,7 +235,7 @@ class _QrCodePassKeyTemplateComponentWidgetState contentPadding: const EdgeInsetsDirectional.fromSTEB( 24.0, 24.0, 20.0, 24.0), suffixIcon: InkWell( - onTap: () => setState( + onTap: () => safeSetState( () => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility, ), diff --git a/lib/modals/index.dart b/lib/modals/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/access_notification/index.dart b/lib/modals/notifications/access_notification/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/modals/notifications/access_notification/model.dart similarity index 92% rename from lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart rename to lib/modals/notifications/access_notification/model.dart index b0f33c80..98a0cbf6 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart +++ b/lib/modals/notifications/access_notification/model.dart @@ -1,6 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'access_notification_modal_template_component_widget.dart' +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show AccessNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/modals/notifications/access_notification/widget.dart similarity index 98% rename from lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart rename to lib/modals/notifications/access_notification/widget.dart index 789b1b44..8c4018e8 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart +++ b/lib/modals/notifications/access_notification/widget.dart @@ -1,11 +1,11 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'access_notification_modal_template_component_model.dart'; -export 'access_notification_modal_template_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { const AccessNotificationModalTemplateComponentWidget({ diff --git a/lib/modals/notifications/index.dart b/lib/modals/notifications/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/message_notificaion/index.dart b/lib/modals/notifications/message_notificaion/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart b/lib/modals/notifications/message_notificaion/model.dart similarity index 92% rename from lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart rename to lib/modals/notifications/message_notificaion/model.dart index 2e5bc0c6..b4dc9501 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart +++ b/lib/modals/notifications/message_notificaion/model.dart @@ -1,6 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'message_notification_widget.dart' +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show MessageNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/modals/notifications/message_notificaion/widget.dart similarity index 98% rename from lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart rename to lib/modals/notifications/message_notificaion/widget.dart index 3a67f3dd..713eebc5 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/modals/notifications/message_notificaion/widget.dart @@ -1,10 +1,10 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'message_notification_model.dart'; +import 'model.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ diff --git a/lib/modals/notifications/visit_request/index.dart b/lib/modals/notifications/visit_request/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/modals/notifications/visit_request/model.dart similarity index 92% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart rename to lib/modals/notifications/visit_request/model.dart index 965cbd4b..e2f51aa9 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart +++ b/lib/modals/notifications/visit_request/model.dart @@ -1,6 +1,5 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show VisitRequestTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/modals/notifications/visit_request/widget.dart similarity index 99% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart rename to lib/modals/notifications/visit_request/widget.dart index 59ac857a..0cd9507d 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/modals/notifications/visit_request/widget.dart @@ -3,12 +3,11 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_model.dart'; - -export 'visit_request_template_component_model.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import 'model.dart'; +export 'model.dart'; class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ diff --git a/lib/modals/selection/bottom_arrow_linked_locals/index.dart b/lib/modals/selection/bottom_arrow_linked_locals/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/modals/selection/bottom_arrow_linked_locals/model.dart similarity index 73% rename from lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart rename to lib/modals/selection/bottom_arrow_linked_locals/model.dart index f0b590e3..6e37e7bd 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart +++ b/lib/modals/selection/bottom_arrow_linked_locals/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'bottom_arrow_linked_locals_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show BottomArrowLinkedLocalsComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/modals/selection/bottom_arrow_linked_locals/widget.dart similarity index 97% rename from lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart rename to lib/modals/selection/bottom_arrow_linked_locals/widget.dart index 40c14a58..2bc89653 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/modals/selection/bottom_arrow_linked_locals/widget.dart @@ -1,14 +1,16 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'bottom_arrow_linked_locals_component_model.dart'; -export 'bottom_arrow_linked_locals_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); diff --git a/lib/modals/selection/index.dart b/lib/modals/selection/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/top_arrow_linked_locals/index.dart b/lib/modals/selection/top_arrow_linked_locals/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/modals/selection/top_arrow_linked_locals/model.dart similarity index 73% rename from lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart rename to lib/modals/selection/top_arrow_linked_locals/model.dart index a63f3b06..291447c3 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart +++ b/lib/modals/selection/top_arrow_linked_locals/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'arrow_linked_locals_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ArrowLinkedLocalsComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/modals/selection/top_arrow_linked_locals/widget.dart similarity index 84% rename from lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart rename to lib/modals/selection/top_arrow_linked_locals/widget.dart index 0738f46c..9bbe184c 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart +++ b/lib/modals/selection/top_arrow_linked_locals/widget.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'arrow_linked_locals_component_model.dart'; -export 'arrow_linked_locals_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class ArrowLinkedLocalsComponentWidget extends StatefulWidget { const ArrowLinkedLocalsComponentWidget({super.key}); diff --git a/lib/modals/selection/up_arrow_linked_locals/index.dart b/lib/modals/selection/up_arrow_linked_locals/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/modals/selection/up_arrow_linked_locals/model.dart similarity index 73% rename from lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart rename to lib/modals/selection/up_arrow_linked_locals/model.dart index e4db1d96..6139bceb 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart +++ b/lib/modals/selection/up_arrow_linked_locals/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'up_arrow_linked_locals_component_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show UpArrowLinkedLocalsComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/modals/selection/up_arrow_linked_locals/widget.dart similarity index 97% rename from lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart rename to lib/modals/selection/up_arrow_linked_locals/widget.dart index fea22bdb..cdd3fb04 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart +++ b/lib/modals/selection/up_arrow_linked_locals/widget.dart @@ -1,12 +1,14 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'up_arrow_linked_locals_component_model.dart'; -export 'up_arrow_linked_locals_component_model.dart'; +import 'model.dart'; +export 'model.dart'; class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); diff --git a/lib/pages/consults/access/index.dart b/lib/pages/consults/access/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/consults/access/model.dart similarity index 84% rename from lib/pages/acess_history_page/acess_history_page_model.dart rename to lib/pages/consults/access/model.dart index a03ec14e..cdd7163a 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/consults/access/model.dart @@ -1,9 +1,11 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; -import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/modals/filters/options/widget.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/request_manager.dart'; + +import 'widget.dart' show AcessHistoryPageWidget; import 'package:flutter/material.dart'; class AcessHistoryPageModel extends FlutterFlowModel { diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/consults/access/widget.dart similarity index 92% rename from lib/pages/acess_history_page/acess_history_page_widget.dart rename to lib/pages/consults/access/widget.dart index ecbbdb94..02c88025 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/consults/access/widget.dart @@ -3,18 +3,19 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/components/molecules/card/widget.dart'; +import 'package:hub/modals/filters/options/widget.dart'; import 'package:rxdart/rxdart.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '../../components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'acess_history_page_model.dart'; -export 'acess_history_page_model.dart'; +import '/commons/widgets/custom_functions.dart' as functions; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import 'model.dart'; +export 'model.dart'; @immutable class AcessHistoryPageWidget extends StatefulWidget { @@ -319,26 +320,48 @@ class _AcessHistoryPageWidgetState extends State { 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', 'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '', }), - statusHashMap: accessHistoryItem['PES_TIPO'] == 'O' + statusHashMap: [ + accessHistoryItem['PES_TIPO'] == 'O' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitado', enText: 'Visited', - ): FlutterFlowTheme.of(context).success, + ): FlutterFlowTheme.of(context).alternate, }) : accessHistoryItem['PES_TIPO'] == 'E' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitante', enText: 'Visitor', - ): FlutterFlowTheme.of(context).warning, + ): FlutterFlowTheme.of(context).alternate, }) : Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', - ): FlutterFlowTheme.of(context).error, + ): FlutterFlowTheme.of(context).alternate, }), + accessHistoryItem['ACE_TIPO'] == '0' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Entrada', + enText: 'Entrada' + ): FlutterFlowTheme.of(context).success, + }) + : accessHistoryItem['ACE_TIPO'] == '1' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Saída', + enText: 'Saída', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).warning, + }) + ], onTapCardItemAction: () async {}); } } diff --git a/lib/pages/consults/index.dart b/lib/pages/consults/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/liberation/index.dart b/lib/pages/consults/liberation/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/consults/liberation/model.dart similarity index 86% rename from lib/pages/liberation_history/liberation_history_model.dart rename to lib/pages/consults/liberation/model.dart index b828bcf3..a0622162 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/consults/liberation/model.dart @@ -1,8 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/commons/actions/api_manager.dart'; -import 'liberation_history_widget.dart' show LiberationHistoryWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/request_manager.dart'; + +import 'widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; class LiberationHistoryModel extends FlutterFlowModel { diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/consults/liberation/widget.dart similarity index 94% rename from lib/pages/liberation_history/liberation_history_widget.dart rename to lib/pages/consults/liberation/widget.dart index 29443a9d..3be711e8 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/consults/liberation/widget.dart @@ -2,23 +2,23 @@ import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; - -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/actions.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/actions/pushNotificationService.dart'; +import 'package:hub/commons/components/molecules/card/widget.dart'; +import 'package:hub/modals/notifications/visit_request/widget.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_model.dart'; -export 'liberation_history_model.dart'; +import 'model.dart'; +export 'model.dart'; class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -308,7 +308,7 @@ Widget liberationHistoryItemCard( 'Data:': liberationHistoryItem['NOT_DTENVIO'], 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' + statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Ativo', @@ -327,7 +327,7 @@ Widget liberationHistoryItemCard( ptText: 'Pendente', enText: 'Pending', ): FlutterFlowTheme.of(context).warning, - }), + })], onTapCardItemAction: () async { showModalBottomSheet( isScrollControlled: true, diff --git a/lib/pages/consults/message/index.dart b/lib/pages/consults/message/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/consults/message/model.dart similarity index 79% rename from lib/pages/message_history_page/message_history_page_model.dart rename to lib/pages/consults/message/model.dart index 1bfa4793..c02496d9 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/consults/message/model.dart @@ -1,8 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/commons/actions/api_manager.dart'; -import 'message_history_page_widget.dart' show MessageHistoryPageWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/request_manager.dart'; + +import 'widget.dart' show MessageHistoryPageWidget; import 'package:flutter/material.dart'; class MessageHistoryPageModel extends FlutterFlowModel { @@ -17,6 +18,10 @@ class MessageHistoryPageModel extends FlutterFlowModel TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + /// Query cache managers for this widget. final _getLiberationsManager = StreamRequestManager(); diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart new file mode 100644 index 00000000..2b7f4710 --- /dev/null +++ b/lib/pages/consults/message/widget.dart @@ -0,0 +1,288 @@ +// import 'dart:js_interop'; + +import 'dart:convert'; +import 'dart:developer'; + +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/actions.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/actions/pushNotificationService.dart'; +import 'package:hub/commons/components/molecules/card/widget.dart'; +import 'package:hub/modals/notifications/visit_request/widget.dart'; +import 'package:json_path/fun_extra.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/custom_functions.dart' as functions; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; +import 'model.dart'; + +class MessageHistoryPageWidget extends StatefulWidget { + const MessageHistoryPageWidget({super.key}); + + @override + State createState() => + _MessageHistoryPageWidgetState(); +} + +class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { + late MessageHistoryPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MessageHistoryPageModel()); + + _model.tabBarController = TabController( + vsync: this, + length: 2, + initialIndex: 0, + )..addListener(() => setState(() {})); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + void onUpdate(BuildContext context) { + _model.clearGetLiberationsCache(); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + context.watch(); + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarMessage(context), + body: bodyMessage(context, _model), + ), + ); + } +} + +PreferredSizeWidget appBarMessage(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Message History', + ptText: 'Histórico de Mensagens', + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); +} + +Widget bodyMessage( + BuildContext context, MessageHistoryPageModel _model) { + return SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getText( + 'ueth1f4g' /* Cadastrar Visita */, + ), + ), + Tab( + text: FFLocalizations.of(context).getText( + 'k4uraqam' /* Histórico de Visitas */, + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded(child: TabBarView( + controller: _model.tabBarController, + children: [ + liberationDynamicListView(context, _model), + Container(), + ] + )), + ].addToStart(const SizedBox(height: 0)), + ), + ); +} + + + + +Widget liberationDynamicListView( + BuildContext context, + MessageHistoryPageModel _model, +) { + return Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getMessagesCall.call( + devUUID: FFAppState().devUUID.toString(), + userUUID: FFAppState().userUUID.toString(), + cliID: FFAppState().cliUUID.toString(), + atividade: 'getMensagens', + pageSize: '100', + pageNumber: '1', + tipoDestino: 'A', + ), + + builder: (context, snapshot) { + // return SizedBox(); + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + // final columnGetLiberationsResponse = snapshot.data!; + // final liberationHistory = PhpGroup.getLiberationsCall + // .rqList( + // columnGetLiberationsResponse.jsonBody, + // ) + // ?.toList() ?? + // []; + // final filteredLiberationHistory = _model.textController.text.isNotEmpty + // ? liberationHistory + // .where((item) => functions + // .jsonToStr(getJsonField( + // item, + // r'''$.VTE_NOME''', + // )) + // .toLowerCase() + // .contains( + // _model.textController.text.toLowerCase(), + // )) + // .toList() + // : liberationHistory; + return ListView.builder( + itemCount: snapshot.data!.jsonBody['total_rows'], + addAutomaticKeepAlives: false, + addRepaintBoundaries: true, + cacheExtent: 1000.0, + itemBuilder: (BuildContext context, int index) { + return messageHistoryItem(context, snapshot.data!.jsonBody['mensagens'][index]); + // final liberationHistoryItem = snapshot.data.jsonBody[index]; + // return Padding( + // padding: EdgeInsets.only( + // top: index == 0 + // ? MediaQuery.of(context).size.height * 0.075 + // : 8.0, + // left: 8.0, + // right: 8.0, + // bottom: 8.0, + // ), + // child: Align( + // alignment: AlignmentDirectional(0.0, 0.0), + // child: messageHistoryItem( + // context, + // liberationHistoryItem, + // ), + // ), + // ); + }, + ); + }, + ), + ); +} + +Widget messageHistoryItem( + BuildContext context, dynamic jsonBody) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text(jsonBody['MSG_ORIGEM_DESC'].toString()), + ), + ], + ), + Text(jsonBody['MSG_TEXTO'].toString()), + ], + ), + ), + ), + ), + ); +} diff --git a/lib/pages/consults/poeple/index.dart b/lib/pages/consults/poeple/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/consults/poeple/model.dart similarity index 80% rename from lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart rename to lib/pages/consults/poeple/model.dart index 31fed050..02e2d099 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/consults/poeple/model.dart @@ -1,5 +1,5 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'people_on_the_property_page_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show PeopleOnThePropertyPageWidget; import 'package:flutter/material.dart'; diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/consults/poeple/widget.dart similarity index 95% rename from lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart rename to lib/pages/consults/poeple/widget.dart index aed5b8f0..ddf4df13 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/consults/poeple/widget.dart @@ -1,14 +1,16 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'people_on_the_property_page_model.dart'; -export 'people_on_the_property_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); diff --git a/lib/pages/consults/qrcode/index.dart b/lib/pages/consults/qrcode/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart b/lib/pages/consults/qrcode/model.dart similarity index 84% rename from lib/pages/qr_code_page/qr_code_page_model.dart rename to lib/pages/consults/qrcode/model.dart index 7770c77e..d1317102 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/consults/qrcode/model.dart @@ -1,6 +1,6 @@ -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_util.dart'; import 'dart:async'; -import 'qr_code_page_widget.dart' show QrCodePageWidget; +import 'widget.dart' show QrCodePageWidget; import 'package:flutter/material.dart'; class QrCodePageModel extends FlutterFlowModel { diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/consults/qrcode/widget.dart similarity index 89% rename from lib/pages/qr_code_page/qr_code_page_widget.dart rename to lib/pages/consults/qrcode/widget.dart index b165965a..07a790be 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/consults/qrcode/widget.dart @@ -1,24 +1,27 @@ +import 'dart:developer'; + import 'package:barcode_widget/barcode_widget.dart'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/flutter_flow/custom_functions.dart'; +import 'package:hub/commons/actions/actions.dart'; +import 'package:hub/commons/widgets/custom_functions.dart'; + +import 'package:hub/modals/forms/qr_code/widget.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'dart:async'; -import '/flutter_flow/custom_functions.dart' as functions; +import '/commons/widgets/custom_functions.dart' as functions; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; // import 'package:percent_indicator/percent_indicator.dart'; -import 'qr_code_page_model.dart'; -export 'qr_code_page_model.dart'; +import 'model.dart'; +export 'model.dart'; import 'package:qr_flutter/qr_flutter.dart'; @@ -203,10 +206,7 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: FFButtonWidget( onPressed: () async { - await _showQrCodeBottomSheet(context).then((value) => _toggleQrCodeAccess()).onError((error, stackTrace) => safeSetState((){ - _resetAnimationAndToggleAccess(); - })); - + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); }, text: FFLocalizations.of(context).getVariableText( ptText: 'Gerar QR Code', @@ -359,20 +359,28 @@ void dispose() { ); } - void _toggleQrCodeAccess() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + + + Future _showBiometricsAuth(BuildContext context) async { + FFAppState().checkBiometrics() + .then((value) => FFAppState().authenticateBiometric() + .then( (value) { + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; + _model.key = FFAppState().fingerprintPass; + }); + } )) + .onError((error, StackTrace) { + _showQrCodeBottomSheet(context); + }); + } - _model.isAccess = !_model.isAccess; - setState(() {}); -} Future _showQrCodeBottomSheet(BuildContext context) async { - if(FFAppState().fingerprint) { - FFAppState().checkBiometrics().then((value) => FFAppState().authenticateBiometric().then( (value) => safeSetState(() {_model.key = FFAppState().accessPass;}) )).catchError((error) => safeSetState((){_resetAnimationAndToggleAccess();})); - - } else { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -391,18 +399,26 @@ void dispose() { child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { + log('Key: $key'); + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; _model.key = key; - setState(() {}); + }); }, ), ), ); }, - ).then((value) => safeSetState(() {})); - }; - - - + ) + + .catchError((error) => safeSetState((){ + log('Error: $error'); + _resetAnimationAndToggleAccess(); + })); unawaited( () async { await _model.qrCodeEncoder( @@ -415,7 +431,7 @@ void dispose() { } void _resetAnimationAndToggleAccess() { - setState(() { + safeSetState(() { // Reinicia a animação animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); diff --git a/lib/pages/consults/visit/index.dart b/lib/pages/consults/visit/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart b/lib/pages/consults/visit/model.dart similarity index 91% rename from lib/pages/visit_history_page/visit_history_page_model.dart rename to lib/pages/consults/visit/model.dart index 327fe168..c334b012 100644 --- a/lib/pages/visit_history_page/visit_history_page_model.dart +++ b/lib/pages/consults/visit/model.dart @@ -1,10 +1,10 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/widgets/request_manager.dart'; import 'package:flutter/material.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'visit_history_page_widget.dart' show VisitHistoryPageWidget; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/form_field_controller.dart'; +import 'widget.dart' show VisitHistoryPageWidget; class VisitHistoryPageModel extends FlutterFlowModel { final _visitHistoryManager = FutureRequestManager(); diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/consults/visit/widget.dart similarity index 98% rename from lib/pages/visit_history_page/visit_history_page_widget.dart rename to lib/pages/consults/visit/widget.dart index ad681eb1..f04af3ed 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/consults/visit/widget.dart @@ -1,19 +1,20 @@ import 'dart:developer'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:f_r_e_hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/modals/details/visit_details_modal/widget.dart'; +import 'package:hub/pages/consults/visit/model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '../../backend/api_requests/api_calls.dart'; -import '../../components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '../../flutter_flow/flutter_flow_icon_button.dart'; -import '../../flutter_flow/flutter_flow_theme.dart'; -import '../../flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/custom_functions.dart' as functions; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ diff --git a/lib/pages/home/index.dart b/lib/pages/home/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home/model.dart similarity index 72% rename from lib/pages/home_page/home_page_model.dart rename to lib/pages/home/model.dart index d938eebc..dde633a3 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home/model.dart @@ -1,10 +1,13 @@ -import 'package:f_r_e_hub/components/organism_components/message_well_component/message_well_component_model.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'home_page_widget.dart' show HomePageWidget; +import 'package:hub/commons/components/atoms/local_header/model.dart'; +import 'package:hub/commons/components/molecules/message_well/model.dart'; +import 'package:hub/commons/components/organisms/menu/model.dart'; +import 'package:hub/modals/filters/selections/widget.dart'; + + + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; class HomePageModel extends FlutterFlowModel { @@ -45,4 +48,6 @@ class HomePageModel extends FlutterFlowModel { menuComponentModel.dispose(); messageWellComponentModel.dispose(); } + + } diff --git a/lib/pages/home/widget.dart b/lib/pages/home/widget.dart new file mode 100644 index 00000000..d66d6199 --- /dev/null +++ b/lib/pages/home/widget.dart @@ -0,0 +1,670 @@ +// import 'package:hub/backend/push_notification/pushNotification.dart'; +import 'dart:developer'; + +import 'package:hub/commons/actions/actions.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/commons/actions/pushNotificationService.dart'; +import 'package:hub/commons/components/atoms/local_header/widget.dart'; +import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; +import 'package:hub/commons/components/molecules/message_well/widget.dart'; +import 'package:hub/commons/components/organisms/menu/widget.dart'; + +import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; +import 'package:hub/pages/schedules/visit/complete/widget.dart'; +import 'package:provider/provider.dart'; + + +import '../../commons/schema/enums/enums.dart'; +import '/commons/widgets/custom_functions.dart' as functions; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import 'model.dart'; +export 'model.dart'; + +class HomePageWidget extends StatefulWidget { + const HomePageWidget({super.key}); + + + + + @override + State createState() => _HomePageWidgetState(); +} + +class _HomePageWidgetState extends State { + late HomePageModel _model; + bool localStatus = false; + final scaffoldKey = GlobalKey(); + + + Future checkLocalStatus() async { + localStatus = await checkLocals( + context: context, + model: _model, + safeSetState: safeSetState, + ); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => HomePageModel()); + SchedulerBinding.instance.addPostFrameCallback((_) async { + await PushNotificationService().initialize(context); + + + + + @override + void initState() { + super.initState(); + checkLocalStatus(); + } + + // Rest of your code... + if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { + showModalBottomSheet( + isScrollControlled: false, + backgroundColor: Colors.transparent, + enableDrag: false, + isDismissible: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } else { + return; + } + }); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + + context.watch(); + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, + drawer: buildDrawer(context), + body: buildPage(context, localStatus), + ), + ); + } + + Container buildPage(BuildContext context, bool localStatus) { + return Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + createHeader(context), + createLocal(localStatus), + createBody(), + ], + ), + ], + ), + ), + ); + } + + Wrap createBody() { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + options: [ + + ], + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Provider( + create: (_) => MessageWellNotifier(), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ), + //footer + const SizedBox( + height: 100, + width: double.infinity, + ) + ], + ); + } + + Widget createLocal(bool localStatus) { + return wrapWithModel( + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: LocalProfileComponentWidget( + localStatus: localStatus, + ), + ); + } + + Row createHeader(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: + FlutterFlowTheme.of(context) + .primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState! + .openDrawer(); + }, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, + ), + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme + .of(context) + .info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Align( + alignment: + const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: + const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: + FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + SizedBox buildDrawer(BuildContext context) { + return SizedBox( + width: 750.0, + child: Drawer( + elevation: 16.0, + child: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Container( + width: double.infinity, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + Container( + width: 150.0, + child: Text( + valueOrDefault( + functions.convertToUppercase( + FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito Sans', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito Sans'), + ), + ), + ), + ].divide(const SizedBox(width: 20.0)), + ), + ), + ), + Container( + width: 50.0, + child: Container( + height: 30.0, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: FlutterFlowIconButton( + borderRadius: 100.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close_sharp, + color: FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + onPressed: () async { + if (scaffoldKey.currentState! + .isDrawerOpen || + scaffoldKey.currentState! + .isEndDrawerOpen) { + Navigator.pop(context); + } + }, + ), + ), + ], + ), + ), + ), + ] + .divide(const SizedBox(width: 0.0)) + .around(const SizedBox(width: 0.0)), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .customColor1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), + ), + ), + ), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), + ), + Flexible( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 20.0, 10.0, 0.0), + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + options: [ + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, + ), + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitors', + ptText: 'Registrar Visitantes', + ), + icon: Icons.person_add_alt_1_outlined, + ), + + ], + expandable: false, + style: MenuView.list, + item: MenuItem.card, + ), + ), + ), + ), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), + ), + ), + ), + ); + } +} diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart deleted file mode 100644 index 00cdc98e..00000000 --- a/lib/pages/home_page/home_page_widget.dart +++ /dev/null @@ -1,1183 +0,0 @@ -// import 'package:f_r_e_hub/backend/push_notification/pushNotification.dart'; -import 'dart:developer'; - -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; - -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'home_page_model.dart'; - -export 'home_page_model.dart'; - -class HomePageWidget extends StatefulWidget { - const HomePageWidget({super.key}); - - @override - State createState() => _HomePageWidgetState(); -} - -class _HomePageWidgetState extends State { - late HomePageModel _model; - bool localStatus = false; - final scaffoldKey = GlobalKey(); - - - Future checkLocalStatus() async { - localStatus = await checkLocals( - context: context, - model: _model, - safeSetState: safeSetState, - ); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => HomePageModel()); - SchedulerBinding.instance.addPostFrameCallback((_) async { - await PushNotificationService().initialize(context); - - - - - @override - void initState() { - super.initState(); - checkLocalStatus(); - } - - // Rest of your code... - if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { - showModalBottomSheet( - isScrollControlled: false, - backgroundColor: Colors.transparent, - enableDrag: false, - isDismissible: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - return; - } - }); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, - drawer: buildDrawer(context), - body: buildPage(context, localStatus), - ), - ); - } - - Container buildPage(BuildContext context, bool localStatus) { - return Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - createHeader(context), - createLocal(localStatus), - createBody(), - ], - ), - ], - ), - ), - ); - } - - Wrap createBody() { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget(), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Provider( - create: (_) => MessageWellNotifier(), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ), - //footer - const SizedBox( - height: 100, - width: double.infinity, - ) - ], - ); - } - - Widget createLocal(bool localStatus) { - return wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: LocalProfileComponentWidget( - localStatus: localStatus, - ), - ); - } - - Row createHeader(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ), - ), - ), - ], - ), - ), - ), - ], - ); - } - - SizedBox buildDrawer(BuildContext context) { - return SizedBox( - width: 750.0, - child: Drawer( - elevation: 16.0, - child: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Container( - width: double.infinity, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Container( - width: 150.0, - child: Text( - valueOrDefault( - functions.convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito Sans'), - ), - ), - ), - ].divide(const SizedBox(width: 20.0)), - ), - ), - ), - Container( - width: 50.0, - child: Container( - height: 30.0, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Flexible( - child: FlutterFlowIconButton( - borderRadius: 100.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close_sharp, - color: FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - if (scaffoldKey.currentState! - .isDrawerOpen || - scaffoldKey.currentState! - .isEndDrawerOpen) { - Navigator.pop(context); - } - }, - ), - ), - ], - ), - ), - ), - ] - .divide(const SizedBox(width: 0.0)) - .around(const SizedBox(width: 0.0)), - ), - ), - ].addToStart(const SizedBox(height: 30.0)), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textControllerValidator - .asValidator(context), - ), - ), - ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Flexible( - child: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kfast, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'dlaeicxd' /* Auto-Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .primary, - size: 24.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '53jd930v' /* Condominio */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'ptsx0rln' /* Cadastrar Pet */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 22.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rgxgw626' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'j2tn9lpw' /* QR Code de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector3, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '9weuwgs1' /* Histórico de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'vuk5bjau' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - ], - ), - ], - ), - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, - ), - borderRadius: BorderRadius.circular(50.0), - ), - ), - ].addToEnd(const SizedBox(height: 64.0)), - ), - ), - ), - ); - } -} diff --git a/lib/pages/index.dart b/lib/pages/index.dart new file mode 100644 index 00000000..e3e432c0 --- /dev/null +++ b/lib/pages/index.dart @@ -0,0 +1,8 @@ + + +import 'consults/index.dart'; +import 'home/index.dart'; +import 'registers/index.dart'; +import 'schedules/index.dart'; +import 'settings/index.dart'; +import 'onboarding/index.dart'; \ No newline at end of file diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart deleted file mode 100644 index 00a96f6f..00000000 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ /dev/null @@ -1,290 +0,0 @@ -// import 'dart:js_interop'; - -import 'dart:developer'; - -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; - -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'message_history_page_model.dart'; - -class MessageHistoryPageWidget extends StatefulWidget { - const MessageHistoryPageWidget({super.key}); - - @override - State createState() => - _MessageHistoryPageWidgetState(); -} - -class _MessageHistoryPageWidgetState extends State { - late MessageHistoryPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MessageHistoryPageModel()); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - void onUpdate(BuildContext context) { - _model.clearGetLiberationsCache(); - setState(() {}); - } - - @override - Widget build(BuildContext context) { - context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarLiberationHistoryPage(context), - body: bodyLiberationHistoryPage(context, _model), - ), - ); - } -} - -PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '784f83pc' /* Histórico de Liberação */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyLiberationHistoryPage( - BuildContext context, MessageHistoryPageModel _model) { - return SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded(child: liberationDynamicListView(context, _model)), - ].addToStart(const SizedBox(height: 0)), - ), - ); -} - - - - -Widget liberationDynamicListView( - BuildContext context, - MessageHistoryPageModel _model, -) { - return Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: StreamBuilder( - stream: _model.getLiberations( - requestFn: () => PhpGroup.getLiberationsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getSolicitacoes', - ), - ), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final columnGetLiberationsResponse = snapshot.data!; - final liberationHistory = PhpGroup.getLiberationsCall - .rqList( - columnGetLiberationsResponse.jsonBody, - ) - ?.toList() ?? - []; - final filteredLiberationHistory = _model.textController.text.isNotEmpty - ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( - item, - r'''$.VTE_NOME''', - )) - .toLowerCase() - .contains( - _model.textController.text.toLowerCase(), - )) - .toList() - : liberationHistory; - - return ListView.builder( - itemCount: filteredLiberationHistory.length, - addAutomaticKeepAlives: false, - addRepaintBoundaries: true, - cacheExtent: 1000.0, - itemBuilder: (BuildContext context, int index) { - final liberationHistoryItem = filteredLiberationHistory[index]; - return Padding( - padding: EdgeInsets.only( - top: index == 0 - ? MediaQuery.of(context).size.height * 0.075 - : 8.0, - left: 8.0, - right: 8.0, - bottom: 8.0, - ), - child: Align( - alignment: AlignmentDirectional(0.0, 0.0), - child: liberationHistoryItemCard( - context, - liberationHistoryItem, - ), - ), - ); - }, - ); - }, - ), - ); -} - -Widget liberationHistoryItemCard( - BuildContext context, dynamic liberationHistoryItem) { - return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), - labelsHashMap: Map.from({ - 'Nome:': liberationHistoryItem['VTE_NOME'], - 'Data:': liberationHistoryItem['NOT_DTENVIO'], - 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], - }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : liberationHistoryItem['NOT_STATUS'] == 'B' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - }), - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return VisitRequestTemplateComponentWidget( - vteName: liberationHistoryItem['VTE_NOME'], - vteReason: liberationHistoryItem['NOT_MOTIVO'], - vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - ? liberationHistoryItem['NOT_DTENVIO'] - : liberationHistoryItem['NOT_DTRESPOSTA'], - vawStatus: liberationHistoryItem['NOT_STATUS'], - vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - vteUUID: liberationHistoryItem['VTE_ID'], - cliUUID: FFAppState().cliUUID, - msgUUID: liberationHistoryItem['NOT_ID'], - vawDestino: liberationHistoryItem['NOT_DESTINO'], - vawUUID: liberationHistoryItem['NOT_ID'], - vawName: liberationHistoryItem['NOT_NOME'], - vawRef: liberationHistoryItem['NOT_ID'], - changeStatusAction: changeStatusAction, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], - ); - }, - ).then((_) { - PushNotificationManager _pushNotificationService = - PushNotificationManager(); - - _pushNotificationService.onMessageReceived.listen((received) { - if (received.data['click_action'] == 'cancel_request') { - log('Aprovado'); - _pushNotificationService.dispose(); - snackbar(context, opt: true); - context.pushReplacementNamed( - 'liberationHistory', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - }); - }); - }, - ); -} diff --git a/lib/pages/onboarding/index.dart b/lib/pages/onboarding/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/pages/onboarding/signin/component.dart similarity index 96% rename from lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart rename to lib/pages/onboarding/signin/component.dart index 59612d43..cfd1f656 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/pages/onboarding/signin/component.dart @@ -1,15 +1,73 @@ -import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; +import 'package:hub/modals/forms/forgot_password/widget.dart'; + +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'sign_in_template_component_model.dart'; -export 'sign_in_template_component_model.dart'; +export 'component.dart'; + + + +class SignInTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'xhnawzcb' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + + // State field(s) for password widget. + FocusNode? passwordFocusNode; + TextEditingController? passwordTextController; + late bool passwordVisibility; + String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9cs5wlmc' /* Campo é necessário */, + ); + } + + return null; + } + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + + passwordFocusNode?.dispose(); + passwordTextController?.dispose(); + } +} + class SignInTemplateComponentWidget extends StatefulWidget { const SignInTemplateComponentWidget({ diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/onboarding/signin/model.dart similarity index 73% rename from lib/pages/sign_in_page/sign_in_page_model.dart rename to lib/pages/onboarding/signin/model.dart index e8b945bd..c5f0d901 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/onboarding/signin/model.dart @@ -1,6 +1,7 @@ -import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_in_page_widget.dart' show SignInPageWidget; +import 'package:hub/pages/onboarding/signin/component.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show SignInPageWidget; import 'package:flutter/material.dart'; class SignInPageModel extends FlutterFlowModel { diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/onboarding/signin/widget.dart similarity index 81% rename from lib/pages/sign_in_page/sign_in_page_widget.dart rename to lib/pages/onboarding/signin/widget.dart index da1727c7..b450d0da 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/onboarding/signin/widget.dart @@ -1,10 +1,11 @@ -import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; +import 'package:hub/pages/onboarding/signin/component.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'sign_in_page_model.dart'; -export 'sign_in_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class SignInPageWidget extends StatefulWidget { const SignInPageWidget({super.key}); diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/pages/onboarding/signup/component.dart similarity index 94% rename from lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart rename to lib/pages/onboarding/signup/component.dart index 0d5327b0..63c763ae 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/pages/onboarding/signup/component.dart @@ -1,16 +1,106 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'sign_up_template_component_model.dart'; -export 'sign_up_template_component_model.dart'; +export 'component.dart'; + + + +class SignUpTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for nameRegisterForm widget. + FocusNode? nameRegisterFormFocusNode; + TextEditingController? nameRegisterFormTextController; + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3bs10dfq' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { + return 'Must start with a letter and can only contain letters, digits and - or _.'; + } + return null; + } + + // State field(s) for emailRegisterForm widget. + FocusNode? emailRegisterFormFocusNode; + TextEditingController? emailRegisterFormTextController; + String? Function(BuildContext, String?)? + emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'mlvw63yj' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + + // State field(s) for passwordRegisterForm widget. + FocusNode? passwordRegisterFormFocusNode; + TextEditingController? passwordRegisterFormTextController; + late bool passwordRegisterFormVisibility; + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '6nn79lmh' /* Campo é necessário */, + ); + } + + return null; + } + + // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. + bool? signUp; + + @override + void initState(BuildContext context) { + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; + passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; + } + + @override + void dispose() { + nameRegisterFormFocusNode?.dispose(); + nameRegisterFormTextController?.dispose(); + + emailRegisterFormFocusNode?.dispose(); + emailRegisterFormTextController?.dispose(); + + passwordRegisterFormFocusNode?.dispose(); + passwordRegisterFormTextController?.dispose(); + } +} + + class SignUpTemplateComponentWidget extends StatefulWidget { const SignUpTemplateComponentWidget({ @@ -655,28 +745,7 @@ class _SignUpTemplateComponentWidgetState padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model.nameRegisterFormTextController - .text != - '') || - ((_model.nameRegisterFormFocusNode?.hasFocus ?? - false) != - null)) && - ((_model.emailRegisterFormTextController - .text != - '') || - ((_model.emailRegisterFormFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.passwordRegisterFormTextController - .text != - '') || - ((_model.passwordRegisterFormFocusNode - ?.hasFocus ?? - false) != - null))) - ? null - : () async { + onPressed: () async { var shouldSetState = false; _model.signUp = await action_blocks diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/onboarding/signup/model.dart similarity index 73% rename from lib/pages/sign_up_page/sign_up_page_model.dart rename to lib/pages/onboarding/signup/model.dart index 938a3b46..94958f8b 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/onboarding/signup/model.dart @@ -1,6 +1,8 @@ -import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_up_page_widget.dart' show SignUpPageWidget; + +import 'package:hub/pages/onboarding/signup/component.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show SignUpPageWidget; import 'package:flutter/material.dart'; class SignUpPageModel extends FlutterFlowModel { diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/onboarding/signup/widget.dart similarity index 81% rename from lib/pages/sign_up_page/sign_up_page_widget.dart rename to lib/pages/onboarding/signup/widget.dart index 18c575ec..a0a9c30a 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/onboarding/signup/widget.dart @@ -1,10 +1,11 @@ -import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; +import 'package:hub/pages/onboarding/signup/component.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'sign_up_page_model.dart'; -export 'sign_up_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class SignUpPageWidget extends StatefulWidget { const SignUpPageWidget({super.key}); diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/pages/onboarding/welcome/component.dart similarity index 98% rename from lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart rename to lib/pages/onboarding/welcome/component.dart index bdb465b1..71c4954f 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ b/lib/pages/onboarding/welcome/component.dart @@ -1,13 +1,24 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import '/commons/widgets/flutter_flow_animations.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'welcome_template_component_model.dart'; -export 'welcome_template_component_model.dart'; +export 'component.dart'; + + +class WelcomeTemplateComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} + + class WelcomeTemplateComponentWidget extends StatefulWidget { const WelcomeTemplateComponentWidget({ diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/onboarding/welcome/model.dart similarity index 75% rename from lib/pages/welcome_page/welcome_page_model.dart rename to lib/pages/onboarding/welcome/model.dart index b8a54a7e..2ad92294 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/onboarding/welcome/model.dart @@ -1,6 +1,7 @@ -import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'welcome_page_widget.dart' show WelcomePageWidget; +import 'package:hub/pages/onboarding/welcome/component.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show WelcomePageWidget; import 'package:flutter/material.dart'; class WelcomePageModel extends FlutterFlowModel { diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/onboarding/welcome/widget.dart similarity index 86% rename from lib/pages/welcome_page/welcome_page_widget.dart rename to lib/pages/onboarding/welcome/widget.dart index 6089703a..af1a8f7d 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/onboarding/welcome/widget.dart @@ -1,12 +1,13 @@ -import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; +import 'package:hub/pages/onboarding/welcome/component.dart'; + +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; -import 'welcome_page_model.dart'; -export 'welcome_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class WelcomePageWidget extends StatefulWidget { const WelcomePageWidget({super.key}); diff --git a/lib/pages/registers/index.dart b/lib/pages/registers/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/pages/registers/visitor/component.dart similarity index 94% rename from lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart rename to lib/pages/registers/visitor/component.dart index 4a00c919..894aa28c 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/pages/registers/visitor/component.dart @@ -1,17 +1,72 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; + +import '/commons/widgets/flutter_flow_drop_down.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import '/commons/widgets/form_field_controller.dart'; +import '/commons/widgets/upload_data.dart'; +import '/commons/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'regisiter_vistor_template_component_model.dart'; -export 'regisiter_vistor_template_component_model.dart'; +export 'component.dart'; + + + +class RegisiterVistorTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + bool isDataUploading = false; + FFUploadedFile uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + // State field(s) for DropDown widget. + String? dropDownValue; + FormFieldController? dropDownValueController; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode4; + TextEditingController? textController4; + String? Function(BuildContext, String?)? textController4Validator; + // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. + String? imgBase64; + // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. + ApiCallResponse? registerVisitor; + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + textFieldFocusNode4?.dispose(); + textController4?.dispose(); + } +} + class RegisiterVistorTemplateComponentWidget extends StatefulWidget { const RegisiterVistorTemplateComponentWidget({super.key}); diff --git a/lib/pages/registers/visitor/index.dart b/lib/pages/registers/visitor/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/registers/visitor/model.dart similarity index 89% rename from lib/pages/register_visitor_page/register_visitor_page_model.dart rename to lib/pages/registers/visitor/model.dart index 08de852d..7023085b 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/registers/visitor/model.dart @@ -1,7 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'register_visitor_page_widget.dart' show RegisterVisitorPageWidget; +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/form_field_controller.dart'; +import 'widget.dart' show RegisterVisitorPageWidget; import 'package:flutter/material.dart'; class RegisterVisitorPageModel diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/registers/visitor/widget.dart similarity index 98% rename from lib/pages/register_visitor_page/register_visitor_page_widget.dart rename to lib/pages/registers/visitor/widget.dart index fb885d1b..63b6267b 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/registers/visitor/widget.dart @@ -1,18 +1,19 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; + +import '/commons/widgets/flutter_flow_drop_down.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import '/commons/widgets/form_field_controller.dart'; +import '/commons/widgets/upload_data.dart'; +import '/commons/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'register_visitor_page_model.dart'; -export 'register_visitor_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class RegisterVisitorPageWidget extends StatefulWidget { const RegisterVisitorPageWidget({super.key}); diff --git a/lib/pages/schedules/index.dart b/lib/pages/schedules/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedules/visit/complete/model.dart similarity index 92% rename from lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart rename to lib/pages/schedules/visit/complete/model.dart index 155fc82c..d2ce64db 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedules/visit/complete/model.dart @@ -1,9 +1,9 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/widgets/request_manager.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'schedule_complete_visit_page_widget.dart' +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/form_field_controller.dart'; +import 'widget.dart' show ScheduleCompleteVisitPageWidget; import 'package:flutter/material.dart'; diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedules/visit/complete/widget.dart similarity index 94% rename from lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart rename to lib/pages/schedules/visit/complete/widget.dart index a01ffeb6..7dbda87d 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedules/visit/complete/widget.dart @@ -1,17 +1,19 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/custom_functions.dart' as functions; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/modals/browsers/visitor_browser/widget.dart'; +import 'package:hub/modals/details/visit_details_modal/widget.dart'; +import 'package:hub/modals/details/visitor_details_modal/widget.dart'; + +import '/commons/widgets/flutter_flow_drop_down.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; +import '/commons/widgets/form_field_controller.dart'; +import '/commons/widgets/custom_functions.dart' as functions; import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -19,8 +21,8 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'schedule_complete_visit_page_model.dart'; -export 'schedule_complete_visit_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ @@ -613,39 +615,7 @@ Widget scheduleVisit( ), ), Row( - mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'qygj6ra5' /* Inicio da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -657,7 +627,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -782,7 +752,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -851,7 +821,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked1Time; if (datePicked1Date != null) { datePicked1Time = @@ -919,7 +889,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { @@ -970,37 +940,6 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ws3t66' /* Fim da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -1012,7 +951,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -1137,7 +1076,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -1206,7 +1145,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked2Time; if (datePicked2Date != null) { datePicked2Time = @@ -1274,7 +1213,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { @@ -1355,41 +1294,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '2f68zi9t' /* Motivo da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, @@ -1488,41 +1396,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'il4di4ln' /* Nível de Acesso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/schedules/visit/fastpass/widget.dart similarity index 97% rename from lib/pages/fast_pass_page/fast_pass_page_widget.dart rename to lib/pages/schedules/visit/fastpass/widget.dart index 556fc661..36f5312f 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/schedules/visit/fastpass/widget.dart @@ -1,13 +1,13 @@ import 'dart:developer'; -import 'package:f_r_e_hub/app_state.dart'; +import 'package:hub/app_state.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'dart:io' show Platform; -import '/flutter_flow/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_util.dart'; class FastPassPageWidget extends StatefulWidget { final String freToken = FFAppState().userUUID; diff --git a/lib/pages/schedules/visit/index.dart b/lib/pages/schedules/visit/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart b/lib/pages/schedules/visit/provisional/model.dart similarity index 93% rename from lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart rename to lib/pages/schedules/visit/provisional/model.dart index 6166e387..9fe405f5 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart +++ b/lib/pages/schedules/visit/provisional/model.dart @@ -1,6 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_provisional_visit_page_widget.dart' +import 'package:hub/commons/actions/api_manager.dart'; + +import '/commons/widgets/flutter_flow_util.dart'; +import 'widget.dart' show ScheduleProvisionalVisitPageWidget; import 'package:flutter/material.dart'; diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedules/visit/provisional/widget.dart similarity index 98% rename from lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart rename to lib/pages/schedules/visit/provisional/widget.dart index 1b5639a8..52dee3ab 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedules/visit/provisional/widget.dart @@ -1,16 +1,19 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/components/templates/exception/widget.dart'; + +import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; + + +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; +import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'schedule_provisional_visit_page_model.dart'; -export 'schedule_provisional_visit_page_model.dart'; +import 'model.dart'; +export 'model.dart'; class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); diff --git a/lib/pages/settings/index.dart b/lib/pages/settings/index.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/settings/model.dart similarity index 87% rename from lib/pages/preferences_settings_page/preferences_settings_model.dart rename to lib/pages/settings/model.dart index bc06c770..7f78258f 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/settings/model.dart @@ -1,11 +1,16 @@ import 'dart:developer'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + +// import 'package:hub/commons/actions/api_calls.dart'; +// import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/commons/actions/api_calls.dart'; +import 'package:hub/commons/widgets/flutter_flow_theme.dart'; +// import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; +import 'package:hub/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/modals/forms/change_password/widget.dart'; class PreferencesPageModel with ChangeNotifier { final unfocusNode = FocusNode(); @@ -135,8 +140,8 @@ class PreferencesPageModel with ChangeNotifier { ) .then((value) { FFAppState().pass = true; - var error = jsonDecode(value.jsonBody['error'].toString()); - log('${jsonDecode(value.jsonBody['error'].toString())}'); + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); if(jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; } else { diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/settings/widget.dart similarity index 52% rename from lib/pages/preferences_settings_page/preferences_settings_widget.dart rename to lib/pages/settings/widget.dart index 9e803f27..fda23372 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/settings/widget.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/settings/model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'preferences_settings_model.dart'; +import '/commons/widgets/flutter_flow_icon_button.dart'; +import '/commons/widgets/flutter_flow_theme.dart'; +import '/commons/widgets/flutter_flow_util.dart'; class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -62,14 +63,14 @@ class PreferencesPageWidget extends StatelessWidget { Container(), Expanded( flex: 2, - child: GridView.builder( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 12.0, - mainAxisSpacing: 12.0, - childAspectRatio: 1.0, - mainAxisExtent: 100.0, - ), + child: ListView.builder( + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 3, + // crossAxisSpacing: 12.0, + // mainAxisSpacing: 12.0, + // childAspectRatio: 1.0, + // mainAxisExtent: 100.0, + // ), itemCount: 6, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), @@ -90,51 +91,106 @@ class PreferencesPageWidget extends StatelessWidget { IconData icon; Function() onPressed =() => {}; bool isEnabled; + String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Desabilita se fingerprint for false + onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative a autenticação por impressão digital para login seguro.', + enText: 'Enable fingerprint authentication for secure login.', + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Exibir código de identificação remota', + enText: 'Display remote identification code', + ); break; case 2: icon = Icons.notifications; onPressed = model.toggleNotify; isEnabled = FFAppState().notify; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para receber sua notificação de acesso', + enText: 'Enable to receive your access notification', + ); break; case 3: icon = Icons.lock_clock_sharp; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de acesso para o QRCode', + enText: 'Enable to enter an access credential for the QRCode', + ); break; case 4: icon = Icons.landscape; onPressed = model.localLogout; isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); break; case 5: icon = Icons.delete; onPressed = () => model.deleteAccount(context); isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Delete sua conta e todos os dados associados permanentemente.', + enText: 'Delete your account and all associated data permanently.', + ); break; default: throw Exception('Invalid index: $index'); } - return FlutterFlowIconButton( - icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), - onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, + return Container( + height: 100, + child: GestureDetector( + onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + child: Row( + children: [ + CircleAvatar( + backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + child: Icon( + icon, + color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), + // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + // disabledColor: FlutterFlowTheme.of(context).alternate, + // disabledIconColor: FlutterFlowTheme.of(context).primary, + ), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + content, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + overflow: TextOverflow.clip, + ), + ), + ], + ), + ), ); } } \ No newline at end of file diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart deleted file mode 100644 index 522b0d2d..00000000 --- a/lib/pages/test_page/test_page.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'dart:developer'; - -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:flutter/material.dart'; - -class TestPage extends StatelessWidget { - const TestPage({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - // Exemplo de dados para os HashMaps - final Map labelsHashMap = { - 'Nome:': 'Gabriel da Silva', - 'Entrada:': '08:00 AM 01/01/2022', - 'Saída:': '17:00 PM 01/01/2022', - }; - - // Ajuste para o novo tipo esperado pelo componente - final Map statusHashMap = { - 'Ativo': FlutterFlowTheme.of(context).success, - }; - - // função set statusHashMap que recebe um String status faz um switch case e retorna um Map - Map getStatusHashMap(String status) { - switch (status) { - case 'Ativo': - return {'Ativo': FlutterFlowTheme.of(context).success}; - case 'Inativo': - return {'Inativo': FlutterFlowTheme.of(context).error}; - default: - return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; - } - } - - // Ajuste para passar os valores corretos para a URL da imagem - final Map imageKeyValue = { - 'key': 'docID', - 'value': 'imageType', - }; - - return Scaffold( - appBar: AppBar( - title: const Text('Test Page'), - ), - body: Center( - child: ListView.builder( - itemCount: 10, - itemBuilder: (context, index) { - return CardItemTemplateComponentWidget( - labelsHashMap: labelsHashMap, - statusHashMap: statusHashMap, - imageHashMap: imageKeyValue, - onTapCardItemAction: () async { - // Ação ao tocar no card - log('Card tapped'); - }, - ); - }), - ), - ); - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 7c09b904..3f38a251 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: f_r_e_hub +name: hub description: A new Flutter project. # The following line prevents the package from being accidentally published to diff --git a/test/widget_test.dart b/test/widget_test.dart index 9e847a93..fce5c632 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:f_r_e_hub/main.dart'; +import 'package:hub/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { From f7e85cea0ba65589b92df3ac98a3c05e869746c2 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 08:31:40 -0300 Subject: [PATCH 02/72] Refactor QR code generation and error handling --- lib/pages/consults/message/model.dart | 2 ++ lib/pages/consults/message/widget.dart | 38 ++++++++++++++++++-------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/pages/consults/message/model.dart b/lib/pages/consults/message/model.dart index c02496d9..a53ccc06 100644 --- a/lib/pages/consults/message/model.dart +++ b/lib/pages/consults/message/model.dart @@ -47,6 +47,8 @@ class MessageHistoryPageModel extends FlutterFlowModel unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); + tabBarController?.dispose(); + /// Dispose query cache managers for this widget. diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index 2b7f4710..e2a2e3fb 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -42,8 +42,8 @@ class _MessageHistoryPageWidgetState extends State wit _model.tabBarController = TabController( vsync: this, - length: 2, - initialIndex: 0, + length: 4, + initialIndex: 1, )..addListener(() => setState(() {})); _model.textController ??= TextEditingController(); @@ -123,7 +123,7 @@ Widget bodyMessage( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ - Align( + Align( alignment: const Alignment(0.0, 0), child: TabBar( labelColor: FlutterFlowTheme.of(context).primaryText, @@ -140,13 +140,21 @@ Widget bodyMessage( padding: const EdgeInsets.all(4.0), tabs: [ Tab( - text: FFLocalizations.of(context).getText( - 'ueth1f4g' /* Cadastrar Visita */, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Pessoal', + enText: 'Personal', ), ), Tab( - text: FFLocalizations.of(context).getText( - 'k4uraqam' /* Histórico de Visitas */, + text: FFLocalizations.of(context).getVariableText( + enText: 'All', + ptText: 'Todos', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Global', + enText: 'Global', ), ), ], @@ -159,8 +167,9 @@ Widget bodyMessage( Expanded(child: TabBarView( controller: _model.tabBarController, children: [ - liberationDynamicListView(context, _model), - Container(), + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'A'), ] )), ].addToStart(const SizedBox(height: 0)), @@ -174,6 +183,7 @@ Widget bodyMessage( Widget liberationDynamicListView( BuildContext context, MessageHistoryPageModel _model, + String DestIndex ) { return Container( width: double.infinity, @@ -187,7 +197,7 @@ Widget liberationDynamicListView( atividade: 'getMensagens', pageSize: '100', pageNumber: '1', - tipoDestino: 'A', + tipoDestino: DestIndex, ), builder: (context, snapshot) { @@ -258,6 +268,7 @@ Widget liberationDynamicListView( Widget messageHistoryItem( BuildContext context, dynamic jsonBody) { + log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Card( @@ -274,8 +285,13 @@ Widget messageHistoryItem( children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text(jsonBody['MSG_ORIGEM_DESC'].toString()), + child: Text(jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ),), ), + Icon(jsonBody['MSG_ORIGEM'] == '20'? Icons.person : Icons.group), ], ), Text(jsonBody['MSG_TEXTO'].toString()), From 8446569042c9dc793e2dff1755e152c7a45c8c38 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 10:03:24 -0300 Subject: [PATCH 03/72] chore: Update tab controller length in message widget --- lib/pages/consults/message/widget.dart | 71 +++++++++----------------- 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index e2a2e3fb..969fdd5f 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -42,7 +42,7 @@ class _MessageHistoryPageWidgetState extends State wit _model.tabBarController = TabController( vsync: this, - length: 4, + length: 3, initialIndex: 1, )..addListener(() => setState(() {})); @@ -169,7 +169,7 @@ Widget bodyMessage( children: [ liberationDynamicListView(context, _model, 'P'), liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), ] )), ].addToStart(const SizedBox(height: 0)), @@ -198,11 +198,16 @@ Widget liberationDynamicListView( pageSize: '100', pageNumber: '1', tipoDestino: DestIndex, - ), - + ).catchError((error) { + log('Error: ${error.toString()}'); + return Future.delayed(Duration(seconds: 1), () { + return Center( + child: Text('Erro ao carregar mensagens'), + ); + }); + }), builder: (context, snapshot) { - // return SizedBox(); - if (!snapshot.hasData) { + if (snapshot.connectionState == ConnectionState.waiting) { return Center( child: SizedBox( width: 50.0, @@ -214,55 +219,27 @@ Widget liberationDynamicListView( ), ); } - // final columnGetLiberationsResponse = snapshot.data!; - // final liberationHistory = PhpGroup.getLiberationsCall - // .rqList( - // columnGetLiberationsResponse.jsonBody, - // ) - // ?.toList() ?? - // []; - // final filteredLiberationHistory = _model.textController.text.isNotEmpty - // ? liberationHistory - // .where((item) => functions - // .jsonToStr(getJsonField( - // item, - // r'''$.VTE_NOME''', - // )) - // .toLowerCase() - // .contains( - // _model.textController.text.toLowerCase(), - // )) - // .toList() - // : liberationHistory; + if (snapshot.hasError == true || snapshot.data == null) { + log('Error: ${snapshot.error.toString()}'); + // log('Error: ${snapshot.data!.jsonBody['mensagens']}'); + return const Center( + child: Text('Erro ao carregar mensagens'), + ); + } return ListView.builder( itemCount: snapshot.data!.jsonBody['total_rows'], addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, itemBuilder: (BuildContext context, int index) { - return messageHistoryItem(context, snapshot.data!.jsonBody['mensagens'][index]); - // final liberationHistoryItem = snapshot.data.jsonBody[index]; - // return Padding( - // padding: EdgeInsets.only( - // top: index == 0 - // ? MediaQuery.of(context).size.height * 0.075 - // : 8.0, - // left: 8.0, - // right: 8.0, - // bottom: 8.0, - // ), - // child: Align( - // alignment: AlignmentDirectional(0.0, 0.0), - // child: messageHistoryItem( - // context, - // liberationHistoryItem, - // ), - // ), - // ); + return messageHistoryItem( + context, + snapshot.data!.jsonBody['mensagens'][index], + ); }, ); }, - ), + ), ); } @@ -291,7 +268,7 @@ Widget messageHistoryItem( color: FlutterFlowTheme.of(context).primary, ),), ), - Icon(jsonBody['MSG_ORIGEM'] == '20'? Icons.person : Icons.group), + Icon(jsonBody['MSG_DESTINO_TP'] == 'T'? Icons.group : Icons.person), ], ), Text(jsonBody['MSG_TEXTO'].toString()), From 7026c0b08e620210e777a01a46096040d2fe19a7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 11:33:28 -0300 Subject: [PATCH 04/72] chore: Update tab controller length in message widget --- assets/images/welcome.svg | 30 +++ lib/app_state.dart | 2 +- lib/modals/forms/change_password/model.dart | 5 +- lib/modals/forms/change_password/widget.dart | 212 +++++++++---------- lib/modals/forms/qr_code/model.dart | 5 +- lib/modals/forms/qr_code/widget.dart | 3 +- lib/pages/consults/message/widget.dart | 40 +++- lib/pages/consults/qrcode/widget.dart | 11 +- lib/pages/onboarding/welcome/component.dart | 4 +- pubspec.yaml | 1 + 10 files changed, 185 insertions(+), 128 deletions(-) create mode 100644 assets/images/welcome.svg diff --git a/assets/images/welcome.svg b/assets/images/welcome.svg new file mode 100644 index 00000000..8983fac0 --- /dev/null +++ b/assets/images/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/app_state.dart b/lib/app_state.dart index a0918b1c..c16883dc 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,4 +1,4 @@ -import 'dart:ffi'; +// import 'dart:ffi'; import 'commons/widgets/permissions_util.dart'; import 'package:flutter/material.dart'; diff --git a/lib/modals/forms/change_password/model.dart b/lib/modals/forms/change_password/model.dart index b2927743..a6144794 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/modals/forms/change_password/model.dart @@ -20,8 +20,9 @@ class PassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } return null; diff --git a/lib/modals/forms/change_password/widget.dart b/lib/modals/forms/change_password/widget.dart index a53a1545..11c2dfa5 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/modals/forms/change_password/widget.dart @@ -166,101 +166,43 @@ class _PassKeyTemplateWidgetState child: SizedBox( width: double.infinity, child: TextFormField( - controller: _model.keyTextFieldTextController1, - focusNode: _model.keyTextFieldFocusNode1, - onChanged: (_) => EasyDebounce.debounce( - '_model.keyTextFieldTextController', - const Duration(milliseconds: 2000), - () { - if (mounted) setState(() {}); - }, - ), - autofillHints: const [AutofillHints.password], - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.done, - obscureText: !_model.keyTextFieldVisibility1, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Senha', - enText: 'Password', + controller: _model.keyTextFieldTextController1, + focusNode: _model.keyTextFieldFocusNode1, + onChanged: (_) => EasyDebounce.debounce( + '_model.keyTextFieldTextController', + const Duration(milliseconds: 2000), + () { + if (mounted) setState(() {}); + }, ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Digite a sua senha.....', - enText: 'Enter your password.....', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 20.0, 24.0), - suffixIcon: InkWell( - onTap: () => setState( - () => _model.keyTextFieldVisibility1 = - !_model.keyTextFieldVisibility1, - ), - focusNode: FocusNode(skipTraversal: true), - child: Icon( - _model.keyTextFieldVisibility1 - ? Icons.visibility_outlined - : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + autofillHints: const [AutofillHints.password], + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.done, + obscureText: !_model.keyTextFieldVisibility1, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Senha', + enText: 'Password', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Digite a sua senha.....', + enText: 'Enter your password.....', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -268,19 +210,77 @@ class _PassKeyTemplateWidgetState fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent3, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + contentPadding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: InkWell( + onTap: () => setState( + () => _model.keyTextFieldVisibility1 = + !_model.keyTextFieldVisibility1, + ), + focusNode: FocusNode(skipTraversal: true), + child: Icon( + _model.keyTextFieldVisibility1 + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), + ), ), - maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.enforced, - buildCounter: (context, - {required currentLength, - required isFocused, - maxLength}) => - null, - keyboardType: TextInputType.number, - cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.keyTextFieldTextControllerValidator1 - .asValidator(context), - inputFormatters: [ + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLength: 4, + maxLengthEnforcement: MaxLengthEnforcement.enforced, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, + keyboardType: TextInputType.number, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.keyTextFieldTextControllerValidator1 + .asValidator(context), + inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), ], ), diff --git a/lib/modals/forms/qr_code/model.dart b/lib/modals/forms/qr_code/model.dart index 1c41f39a..1c9aa433 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/modals/forms/qr_code/model.dart @@ -16,8 +16,9 @@ class QrCodePassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/modals/forms/qr_code/widget.dart index 0bf75907..6ffff798 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/modals/forms/qr_code/widget.dart @@ -163,7 +163,6 @@ class _QrCodePassKeyTemplateComponentWidgetState width: double.infinity, child: TextFormField( controller: _model.keyTextFieldTextController, - focusNode: _model.keyTextFieldFocusNode, onChanged: (_) => EasyDebounce.debounce( '_model.keyTextFieldTextController', @@ -259,7 +258,7 @@ class _QrCodePassKeyTemplateComponentWidgetState .containsKey('Plus Jakarta Sans'), ), maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.none, + maxLengthEnforcement: MaxLengthEnforcement.enforced, buildCounter: (context, {required currentLength, required isFocused, diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index 969fdd5f..fe7b90a8 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -257,18 +257,38 @@ Widget messageHistoryItem( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text(jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ),), + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + ), ), - Icon(jsonBody['MSG_DESTINO_TP'] == 'T'? Icons.group : Icons.person), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Container( + width: 100, // Adjust the width as needed + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ), + Icon(jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, color: FlutterFlowTheme.of(context).accent1,), ], ), Text(jsonBody['MSG_TEXTO'].toString()), @@ -277,5 +297,7 @@ Widget messageHistoryItem( ), ), ), - ); + ); + + } diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/consults/qrcode/widget.dart index 07a790be..72fe46a0 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/consults/qrcode/widget.dart @@ -151,9 +151,12 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( onTap: () { - safeSetState(() { - - }); + + safeSetState(() async { + _resetAnimationAndToggleAccess(); + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + }); + }, child: buildQrCode( dimension: dimension, @@ -184,7 +187,7 @@ void dispose() { ), ), if (_model.isAccess == false && _model.key == null) - Align( + Align( alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( splashColor: Colors.transparent, diff --git a/lib/pages/onboarding/welcome/component.dart b/lib/pages/onboarding/welcome/component.dart index 71c4954f..a489e5f7 100644 --- a/lib/pages/onboarding/welcome/component.dart +++ b/lib/pages/onboarding/welcome/component.dart @@ -175,8 +175,8 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', + child: SvgPicture.asset( + 'assets/images/welcome.svg', width: 603.0, height: double.infinity, fit: BoxFit.contain, diff --git a/pubspec.yaml b/pubspec.yaml index 3f38a251..dfe4419b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -133,6 +133,7 @@ flutter_launcher_icons: adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg' + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From c7ae2744fdd8214be1598387685629a484615390 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Thu, 25 Jul 2024 11:38:47 -0300 Subject: [PATCH 05/72] =?UTF-8?q?fix:=20Corrigido=20Imagem=20da=20Tela=20d?= =?UTF-8?q?e=20Welcome=20quando=20n=C3=A3o=20ter=20Internet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/dark/login.svg | 29 ++++++++++++++++++ assets/images/dark/welcome.svg | 30 +++++++++++++++++++ assets/images/light/login.svg | 22 ++++++++++++++ assets/images/light/welcome.svg | 30 +++++++++++++++++++ lib/pages/onboarding/signin/component.dart | 8 ++--- lib/pages/onboarding/welcome/component.dart | 9 ++---- .../atoms/atom_image_svg_theme.dart | 29 ++++++++++++++++++ pubspec.yaml | 2 ++ 8 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 assets/images/dark/login.svg create mode 100644 assets/images/dark/welcome.svg create mode 100644 assets/images/light/login.svg create mode 100644 assets/images/light/welcome.svg create mode 100644 lib/shared/components/atoms/atom_image_svg_theme.dart diff --git a/assets/images/dark/login.svg b/assets/images/dark/login.svg new file mode 100644 index 00000000..6da3ef72 --- /dev/null +++ b/assets/images/dark/login.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dark/welcome.svg b/assets/images/dark/welcome.svg new file mode 100644 index 00000000..c9043f96 --- /dev/null +++ b/assets/images/dark/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/login.svg b/assets/images/light/login.svg new file mode 100644 index 00000000..f6890b23 --- /dev/null +++ b/assets/images/light/login.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/welcome.svg b/assets/images/light/welcome.svg new file mode 100644 index 00000000..8983fac0 --- /dev/null +++ b/assets/images/light/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/pages/onboarding/signin/component.dart b/lib/pages/onboarding/signin/component.dart index cfd1f656..73b006ba 100644 --- a/lib/pages/onboarding/signin/component.dart +++ b/lib/pages/onboarding/signin/component.dart @@ -1,4 +1,5 @@ import 'package:hub/modals/forms/forgot_password/widget.dart'; +import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; import '/commons/widgets/flutter_flow_animations.dart'; import '/commons/widgets/flutter_flow_theme.dart'; @@ -223,12 +224,7 @@ class _SignInTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), + child: const AtomImageSVGTheme(filename: 'login', width: 600, height: 155), ), ), Column( diff --git a/lib/pages/onboarding/welcome/component.dart b/lib/pages/onboarding/welcome/component.dart index 71c4954f..e9cece8f 100644 --- a/lib/pages/onboarding/welcome/component.dart +++ b/lib/pages/onboarding/welcome/component.dart @@ -1,3 +1,5 @@ +import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; + import '/commons/widgets/flutter_flow_animations.dart'; import '/commons/widgets/flutter_flow_theme.dart'; import '/commons/widgets/flutter_flow_util.dart'; @@ -175,12 +177,7 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', - width: 603.0, - height: double.infinity, - fit: BoxFit.contain, - ), + child: const AtomImageSVGTheme(filename: 'welcome', width: 600, height: double.infinity), ), ), Align( diff --git a/lib/shared/components/atoms/atom_image_svg_theme.dart b/lib/shared/components/atoms/atom_image_svg_theme.dart new file mode 100644 index 00000000..6da1479c --- /dev/null +++ b/lib/shared/components/atoms/atom_image_svg_theme.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class AtomImageSVGTheme extends StatelessWidget { + + final String filename; + final double width; + final double height; + + const AtomImageSVGTheme({ + super.key, + required this.filename, + required this.width, + required this.height + }); + + @override + Widget build(BuildContext context) { + final brightness = MediaQuery.of(context).platformBrightness; + final isDarkMode = brightness == Brightness.dark; + final pathImage = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; + + return SvgPicture.asset( + pathImage, + width: width, + height: height, + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 3f38a251..5aa0755c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -148,6 +148,8 @@ flutter: assets: - assets/fonts/ - assets/images/ + - assets/images/dark/ + - assets/images/light/ - assets/videos/ - assets/audios/ - assets/lottie_animations/ From 7c721b6768fe8da7124f494a15a349ccd5a6b1f4 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 15:13:30 -0300 Subject: [PATCH 06/72] chore: Update tab controller length in message widget --- lib/commons/actions/actions.dart | 31 ++- .../components/molecules/card/widget.dart | 4 +- lib/commons/widgets/flutter_flow_theme.dart | 3 + lib/commons/widgets/internationalization.dart | 2 +- lib/main.dart | 5 + lib/modals/forms/change_password/model.dart | 6 +- lib/modals/forms/change_password/widget.dart | 9 +- lib/modals/forms/qr_code/model.dart | 4 + lib/modals/forms/qr_code/widget.dart | 12 +- lib/pages/consults/access/widget.dart | 14 +- lib/pages/consults/message/widget.dart | 121 +++++---- lib/pages/consults/poeple/widget.dart | 234 ++++++++---------- lib/pages/consults/qrcode/widget.dart | 20 +- lib/pages/onboarding/signin/component.dart | 50 ++-- lib/pages/onboarding/signup/component.dart | 37 +-- 15 files changed, 289 insertions(+), 263 deletions(-) diff --git a/lib/commons/actions/actions.dart b/lib/commons/actions/actions.dart index e63acea4..b16ce6e8 100644 --- a/lib/commons/actions/actions.dart +++ b/lib/commons/actions/actions.dart @@ -19,6 +19,17 @@ import '/commons/widgets/flutter_flow_theme.dart'; import '/commons/widgets/flutter_flow_util.dart'; import '/commons/widgets/random_data_util.dart' as random_data; + +import 'package:url_launcher/url_launcher.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} + Future repeatVisitScheduleAction( BuildContext context, { List? visitorJsonList, @@ -237,8 +248,8 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR2'), - content: const Text('ERROR2'), + title: const Text('Error'), + content: Text('${registerCall?.jsonBody}'), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), @@ -254,12 +265,21 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR1'), - content: const Text('ERROR1'), + title: Text(FFLocalizations.of(context).getVariableText( + enText: 'Error', + ptText: 'Erro', + )), + content: Text(FFLocalizations.of(context).getVariableText( + enText: 'Please fill in all fields', + ptText: 'Por favor, preencha todos os campos', + )), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR1 '), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: 'Fechar', + enText: 'Close', + )), ), ], ); @@ -314,6 +334,7 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( 'signUpPage', extra: { diff --git a/lib/commons/components/molecules/card/widget.dart b/lib/commons/components/molecules/card/widget.dart index 47f1a027..1452e832 100644 --- a/lib/commons/components/molecules/card/widget.dart +++ b/lib/commons/components/molecules/card/widget.dart @@ -187,10 +187,10 @@ class _CardItemTemplateComponentWidgetState return linkedHashMap.entries.map((MapEntry item) { return Container( child: Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 3.0), + padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), child: Container( width: 100.0, height: 27.0, diff --git a/lib/commons/widgets/flutter_flow_theme.dart b/lib/commons/widgets/flutter_flow_theme.dart index 12792945..9bc83617 100644 --- a/lib/commons/widgets/flutter_flow_theme.dart +++ b/lib/commons/widgets/flutter_flow_theme.dart @@ -50,6 +50,7 @@ abstract class FlutterFlowTheme { late Color secondary; late Color tertiary; late Color alternate; + late Color alternate2; late Color primaryText; late Color secondaryText; late Color primaryBackground; @@ -160,6 +161,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFFB59E9E); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFFF2F2F2); + late Color alternate2 = const Color(0xFF232323); late Color primaryText = const Color(0xFF000000); late Color secondaryText = const Color(0xFFFFFFFF); late Color primaryBackground = const Color(0xFFFFFFFF); @@ -559,6 +561,7 @@ class DarkModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFF18AA99); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFF232323); + late Color alternate2 = const Color(0xFF171717); late Color primaryText = const Color(0xFFFFFFFF); late Color secondaryText = const Color(0xFF000000); late Color primaryBackground = const Color(0xFF171717); diff --git a/lib/commons/widgets/internationalization.dart b/lib/commons/widgets/internationalization.dart index e535962b..9b26d8dd 100644 --- a/lib/commons/widgets/internationalization.dart +++ b/lib/commons/widgets/internationalization.dart @@ -967,7 +967,7 @@ final kTranslationsMap = >>[ }, 'a9smhn5b': { 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', + 'en': 'You already have an account? ', }, '09xv5ctc': { 'pt': 'Clique aqui', diff --git a/lib/main.dart b/lib/main.dart index 19cd912a..e15dc32e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,11 +9,16 @@ import 'package:flutter_web_plugins/url_strategy.dart'; import 'commons/widgets/flutter_flow_theme.dart'; import 'commons/widgets/flutter_flow_util.dart'; import 'commons/widgets/internationalization.dart'; +import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); void main() async { WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); await initializeApp(); runApp(ChangeNotifierProvider( create: (context) => FFAppState(), diff --git a/lib/modals/forms/change_password/model.dart b/lib/modals/forms/change_password/model.dart index a6144794..924ec401 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/modals/forms/change_password/model.dart @@ -19,12 +19,16 @@ class PassKeyTemplateComponentModel String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2; String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { - if (val == null || val.isEmpty) { + if (val == null || val.isEmpty ) { return FFLocalizations.of(context).getVariableText( enText: 'This field is required', ptText: 'Este campo é obrigatório', ); } + if ( val.length < 4 ) return FFLocalizations.of(context).getVariableText( + enText: 'This field must have at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/modals/forms/change_password/widget.dart b/lib/modals/forms/change_password/widget.dart index 11c2dfa5..ccecaa4c 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/modals/forms/change_password/widget.dart @@ -158,7 +158,7 @@ class _PassKeyTemplateWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ Padding( @@ -189,7 +189,7 @@ class _PassKeyTemplateWidgetState .labelMedium .override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -213,14 +213,14 @@ class _PassKeyTemplateWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -282,6 +282,7 @@ class _PassKeyTemplateWidgetState .asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), ], ), ), diff --git a/lib/modals/forms/qr_code/model.dart b/lib/modals/forms/qr_code/model.dart index 1c9aa433..813a6c2a 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/modals/forms/qr_code/model.dart @@ -21,6 +21,10 @@ class QrCodePassKeyTemplateComponentModel ptText: 'Este campo é obrigatório', ); } + if (val.length < 4) return FFLocalizations.of(context).getVariableText( + enText: 'This field must be at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/modals/forms/qr_code/widget.dart index 6ffff798..8f31f358 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/modals/forms/qr_code/widget.dart @@ -156,7 +156,7 @@ class _QrCodePassKeyTemplateComponentWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( @@ -181,7 +181,7 @@ class _QrCodePassKeyTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -203,14 +203,14 @@ class _QrCodePassKeyTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -269,7 +269,9 @@ class _QrCodePassKeyTemplateComponentWidgetState validator: _model.keyTextFieldTextControllerValidator .asValidator(context), inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')) + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), + ], ), ), diff --git a/lib/pages/consults/access/widget.dart b/lib/pages/consults/access/widget.dart index 02c88025..cec1e538 100644 --- a/lib/pages/consults/access/widget.dart +++ b/lib/pages/consults/access/widget.dart @@ -324,35 +324,35 @@ class _AcessHistoryPageWidgetState extends State { accessHistoryItem['PES_TIPO'] == 'O' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Visitado', - enText: 'Visited', - ): FlutterFlowTheme.of(context).alternate, + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, }) : accessHistoryItem['PES_TIPO'] == 'E' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitante', enText: 'Visitor', - ): FlutterFlowTheme.of(context).alternate, + ): FlutterFlowTheme.of(context).alternate2, }) : Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, + ): FlutterFlowTheme.of(context).alternate2, }), accessHistoryItem['ACE_TIPO'] == '0' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Entrada', - enText: 'Entrada' + enText: 'Entrance', ): FlutterFlowTheme.of(context).success, }) : accessHistoryItem['ACE_TIPO'] == '1' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Saída', - enText: 'Saída', + enText: 'Exit', ): FlutterFlowTheme.of(context).error, }) : Map.from({ diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index fe7b90a8..d390f66d 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -1,21 +1,13 @@ // import 'dart:js_interop'; -import 'dart:convert'; import 'dart:developer'; import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; -import 'package:json_path/fun_extra.dart'; import '/commons/widgets/flutter_flow_icon_button.dart'; import '/commons/widgets/flutter_flow_theme.dart'; import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -65,16 +57,11 @@ class _MessageHistoryPageWidgetState extends State wit @override Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarMessage(context), - body: bodyMessage(context, _model), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarMessage(context), + body: bodyMessage(context, _model), ); } } @@ -247,57 +234,67 @@ Widget messageHistoryItem( BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Card( - child: Container( - // height: 100, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ), - ), + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + overflow: TextOverflow.ellipsis, ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Container( - width: 100, // Adjust the width as needed - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon(jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, color: FlutterFlowTheme.of(context).accent1,), - ], + ), ), - Text(jsonBody['MSG_TEXTO'].toString()), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ) ], ), - ), + SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ), + ], + ), + SizedBox(height: 8), + Text(jsonBody['MSG_TEXTO'].toString(),), + ], ), ), - ); + ), + ), + ); } diff --git a/lib/pages/consults/poeple/widget.dart b/lib/pages/consults/poeple/widget.dart index ddf4df13..313bff9f 100644 --- a/lib/pages/consults/poeple/widget.dart +++ b/lib/pages/consults/poeple/widget.dart @@ -43,136 +43,118 @@ class _PeopleOnThePropertyPageWidgetState Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'nsu13r5d' /* Pessoas na Propriedade */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: FutureBuilder( - future: PhpGroup.getPessoasLocalCall.call( - cliID: FFAppState().cliUUID, - ownID: FFAppState().ownerUUID, - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final columnGetPessoasLocalResponse = snapshot.data!; - return Builder( - builder: (context) { - final getPoepleProperty = PhpGroup.getPessoasLocalCall - .pessoas( - columnGetPessoasLocalResponse.jsonBody, - ) - ?.toList() ?? - []; - - return Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: List.generate(getPoepleProperty.length, - (getPoeplePropertyIndex) { - final getPoeplePropertyItem = - getPoepleProperty[getPoeplePropertyIndex]; - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - ), - Text( - getJsonField( - getPoeplePropertyItem, - r'''$.USU_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 40.0)), - ); - }).divide(const SizedBox(height: 3.0)), - ); - }, - ); - }, + title: Text( + FFLocalizations.of(context).getText( + 'nsu13r5d' /* Pessoas na Propriedade */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: FutureBuilder( + future: PhpGroup.getPessoasLocalCall.call( + cliID: FFAppState().cliUUID, + ownID: FFAppState().ownerUUID, + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final columnGetPessoasLocalResponse = snapshot.data!; + final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? + []; + return ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: getPoepleProperty.length, + itemBuilder: (context, index) { + final getPoeplePropertyItem = getPoepleProperty[index]; + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + fit: BoxFit.cover, + ), + ), + ), + Text( + getJsonField( + getPoeplePropertyItem, + r'''$.USU_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 40.0)), + ); + }, + ); + }, ), ), ); diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/consults/qrcode/widget.dart index 72fe46a0..c95570b3 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/consults/qrcode/widget.dart @@ -102,16 +102,11 @@ void dispose() { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: buildAppBar(context), - body: buildBody(context), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: buildAppBar(context), + body: buildBody(context), ); } @@ -120,16 +115,15 @@ void dispose() { double screenHeight = MediaQuery.of(context).size.height; double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; - double totalTimeInSeconds = 100.0; return SafeArea( - top: true, + // top: true, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (_model.isAccess == true && _model.key != null) - Text( + Text( FFLocalizations.of(context).getVariableText( ptText: 'Use esse QR Code para acesso', enText: 'Use this QR Code for access', diff --git a/lib/pages/onboarding/signin/component.dart b/lib/pages/onboarding/signin/component.dart index cfd1f656..7b1a90c8 100644 --- a/lib/pages/onboarding/signin/component.dart +++ b/lib/pages/onboarding/signin/component.dart @@ -262,7 +262,7 @@ class _SignInTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.always, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -1007,28 +1007,34 @@ class _SignInTemplateComponentWidgetState ), ), ), - Text( - FFLocalizations.of(context).getText( - 'olf967cj' /* Termo de Uso */, + GestureDetector( + onTap: () async { + await action_blocks.openTermsOfUse(context); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Termos de uso', + enText: 'Terms of use', + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), ), ], ), diff --git a/lib/pages/onboarding/signup/component.dart b/lib/pages/onboarding/signup/component.dart index 63c763ae..50e21802 100644 --- a/lib/pages/onboarding/signup/component.dart +++ b/lib/pages/onboarding/signup/component.dart @@ -298,7 +298,7 @@ class _SignUpTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.disabled, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -843,8 +843,9 @@ class _SignUpTemplateComponentWidgetState TextSpan( text: FFLocalizations.of( context) - .getText( - 'a9smhn5b' /* Você já tem uma conta? */, + .getVariableText( + ptText: 'Você já tem uma conta? ', + enText: 'Already have an account? ', ), style: TextStyle( color: FlutterFlowTheme.of( @@ -909,19 +910,25 @@ class _SignUpTemplateComponentWidgetState ), ], ), - Text( - FFLocalizations.of(context).getText( - 'huygnka2' /* Termo de Uso */, + GestureDetector( + onTap: () async { + await action_blocks.openTermsOfUse(context); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Termos de uso', + enText: 'Terms of use', + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), ), ], ), From 8eeda2d54b35fccf2b6db1bc97c2bff65372a4ca Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 29 Jul 2024 09:36:46 -0300 Subject: [PATCH 07/72] fix: add form validador --- lib/flutter_flow/upload_data.dart | 16 +- .../register_visitor_page_model.dart | 59 +- .../register_visitor_page_widget.dart | 1501 +++++++++-------- 3 files changed, 837 insertions(+), 739 deletions(-) diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 6b6baf2b..917034cd 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -52,8 +52,8 @@ Future?> selectMediaWithSourceBottomSheet({ required bool allowPhoto, bool allowVideo = false, String pickerFontFamily = 'Roboto', - Color textColor = const Color(0xFF111417), - Color backgroundColor = const Color(0xFFF5F5F5), + // Color textColor = const Color(0xFF111417), + // Color backgroundColor = const Color(0xFFF5F5F5), bool includeDimensions = false, bool includeBlurHash = false, }) async { @@ -63,12 +63,12 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor, + color: FlutterFlowTheme.of(context).primaryText, fontWeight: FontWeight.w600, fontSize: 20, ), ), - tileColor: backgroundColor, + tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: false, onTap: () => Navigator.pop( context, @@ -77,7 +77,7 @@ Future?> selectMediaWithSourceBottomSheet({ ); final mediaSource = await showModalBottomSheet( context: context, - backgroundColor: backgroundColor, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, builder: (context) { return Column( mainAxisSize: MainAxisSize.min, @@ -91,13 +91,13 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor.withOpacity(0.65), + color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), ), - tileColor: backgroundColor, - dense: false, + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: true, ), ), const Divider(), diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 96b3252e..7c216c8d 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -17,10 +17,28 @@ class RegisterVisitorPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for DropDown widget. String? dropDownValue; FormFieldController? dropDownValueController; @@ -28,17 +46,56 @@ class RegisterVisitorPageModel FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for TextField widget. FocusNode? textFieldFocusNode4; TextEditingController? textController4; String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. String? imgBase64; // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. ApiCallResponse? scheduleVisitor; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } @override void dispose() { diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index c495da52..ea48ca5f 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -116,772 +116,813 @@ class _RegisterVisitorPageWidgetState extends State { ), ), child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Builder( + builder: (context) { + if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + setState(() { + _model.isDataUploading = false; + _model.uploadedLocalFile = FFUploadedFile( + bytes: Uint8List.fromList([])); + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.memory( + _model.uploadedLocalFile.bytes ?? + Uint8List.fromList([]), + width: 300.0, + height: 200.0, + fit: BoxFit.cover, + ), ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath - .split('/') - .last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; + ); + } else { + return Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: FFButtonWidget( + onPressed: () async { + final selectedMedia = + await selectMediaWithSourceBottomSheet( + context: context, + maxWidth: 300.00, + maxHeight: 300.00, + imageQuality: 0, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null && + selectedMedia.every((m) => + validateFileFormat( + m.storagePath, context))) { + setState( + () => _model.isDataUploading = true); + var selectedUploadedFiles = + []; + + try { + showUploadMessage( + context, + 'Uploading file...', + showLoading: true, + ); + selectedUploadedFiles = selectedMedia + .map((m) => FFUploadedFile( + name: m.storagePath + .split('/') + .last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + blurHash: m.blurHash, + )) + .toList(); + } finally { + ScaffoldMessenger.of(context) + .hideCurrentSnackBar(); + _model.isDataUploading = false; + } + if (selectedUploadedFiles.length == + selectedMedia.length) { + setState(() { + _model.uploadedLocalFile = + selectedUploadedFiles.first; + }); + showUploadMessage(context, 'Success!'); + } else { + setState(() {}); + showUploadMessage( + context, 'Failed to upload data'); + return; + } } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, + }, + text: '', + icon: Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context).accent1, + size: 30.0, + ), + options: FFButtonOptions( + width: 300.0, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, + 0.0, 50.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy' /* Clique para adicionar a foto p... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), - borderRadius: BorderRadius.circular(8.0), ), ), + ], + ); + } + }, + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'zazj5d8b' /* Preencha o formulário com os d... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'v7g73yik' /* Nome */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context).error, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodySmallFamily), + )), ), ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'bqpucwh0' /* Contatos */, ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).accent1, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( + Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'h84ls2r6' /* Telefone */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.phone, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController3Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'fqp7qmka' /* Email */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + keyboardType: TextInputType.emailAddress, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + if (((_model.uploadedLocalFile.bytes + ?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: '7654553234232342', + nome: 'Test', + tipo: 'V', + foto: 'base64;jpeg,klajsalkjslkajslkajl', + ).onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context).getVariableText( + ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); }); + + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + }); + setState(() { + _model.dropDownValueController?.reset(); + }); + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg:FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao cadastrar visitante. Tente novamente.', + enText: 'Error registering visitor. Try again.', + ), + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, + await showAdaptiveDialog( context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => Navigator.pop(context), child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.scheduleVisitor?.jsonBody ?? - ''), - )}', + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context).getVariableText( + ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), ), - ), + ), ); }, ).then((value) => safeSetState(() {})); } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, + + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.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: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), ), ), ), ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)), + ), ), ), ), From d95c82d3557ece5ced293246fd37e0b635abba83 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 30 Jul 2024 11:06:32 -0300 Subject: [PATCH 08/72] misc --- lib/actions/actions.dart | 388 ++++---- lib/app_state.dart | 58 +- .../throw_exception_widget.dart | 5 +- .../visitor_not_found_component_widget.dart | 33 +- ...ot_password_template_component_widget.dart | 488 ++++----- ...siter_vistor_template_component_model.dart | 94 +- ...iter_vistor_template_component_widget.dart | 638 +++++++----- .../sign_in_template_component_model.dart | 1 + .../sign_in_template_component_widget.dart | 179 ++-- ...earch_modal_template_component_widget.dart | 800 ++++++++------- lib/flutter_flow/flutter_flow_util.dart | 89 +- lib/pages/home_page/home_page_widget.dart | 908 ++++++++--------- .../preferences_settings_model.dart | 245 +++-- .../preferences_settings_widget.dart | 107 +- .../register_visitor_page_model.dart | 108 +- .../register_visitor_page_widget.dart | 933 +----------------- .../schedule_complete_visit_page_model.dart | 4 +- .../schedule_complete_visit_page_widget.dart | 250 ++--- 18 files changed, 2388 insertions(+), 2940 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 5d80d184..a0bc441a 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -16,9 +16,6 @@ import 'package:hub/flutter_flow/random_data_util.dart'; import 'package:hub/pages/home_page/home_page_model.dart'; import 'package:qr_flutter/qr_flutter.dart'; - - - import 'package:url_launcher/url_launcher.dart'; Future openTermsOfUse(BuildContext context) async { @@ -165,6 +162,7 @@ Future singInLoginAction( return; } else { await showModalBottomSheet( + useRootNavigator: true, isScrollControlled: true, backgroundColor: Colors.transparent, useSafeArea: true, @@ -333,7 +331,6 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { - context.pushNamed( 'signUpPage', extra: { @@ -468,12 +465,12 @@ Future checkLocals({ ), ), ); - safeSetState(() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. + safeSetState( + () {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. return false; } } - Future changeStatusAction( BuildContext context, String status, @@ -523,13 +520,9 @@ Future changeStatusAction( default: break; } - - } - -/// QR Code - +/// QR Code Uint8List assembleQRPacket(int direction, String identifier, String password) { List packet = [direction]; @@ -569,13 +562,15 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) { check ^= b; } - if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) { + if (check == int.parse('0D', radix: 16) || + check == int.parse('0A', radix: 16)) { packet.add(int.parse('FF', radix: 16)); } else { packet.add(check); } - var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); + var bytes = + packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); log("Pacote: $packet"); log("Bytes: $bytes"); @@ -586,22 +581,24 @@ Uint8List hexStringToByteArray(String s) { int len = s.length; Uint8List data = Uint8List(len ~/ 2); for (int i = 0; i < len; i += 2) { - data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); + data[i ~/ 2] = + ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); } return data; } String byteToHexa(Uint8List pDados) { - return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join(); + return pDados + .map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()) + .join(); } Future byteToString(Uint8List bytes) async { return String.fromCharCodes(bytes); } - Widget buildQrCode( -{ + { // required String data, // required String type, // required int version, @@ -610,204 +607,207 @@ Widget buildQrCode( required double dimension, required String identifier, required String pass, - required int direction - } - ) { + required int direction}) { try { log("pass: $pass"); const Color backgroundColor = Colors.white; const Color foregroundColor = Colors.black; - return QrImageView.withQr(qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, foregroundColor: foregroundColor); + return QrImageView.withQr( + qr: QrCode.fromUint8List( + data: assembleQRPacket(direction, identifier, pass), + errorCorrectLevel: errorCorrectLevel), + size: dimension, + padding: const EdgeInsets.all(10), + backgroundColor: backgroundColor, + foregroundColor: foregroundColor); } catch (e) { return Text("Erro ao gerar QR Code: ${e.toString()}"); } } +// // Retorna o conteúdo a ser codificado no QR Code. +// String getContents() { +// return data; +// } - // // Retorna o conteúdo a ser codificado no QR Code. - // String getContents() { - // return data; - // } +// // Retorna uma versão do conteúdo otimizada para exibição. +// String getDisplayContents() { +// return data.trim(); +// } - // // Retorna uma versão do conteúdo otimizada para exibição. - // String getDisplayContents() { - // return data.trim(); - // } +// // Retorna o título baseado no tipo de conteúdo. +// String getTitle() { +// return type; +// } - // // Retorna o título baseado no tipo de conteúdo. - // String getTitle() { - // return type; - // } +// // Codifica o conteúdo em uma string adequada para o QR Code. +// Future encodeContents() async { +// // Implementação específica para codificar o conteúdo. +// return data; // Exemplo simplificado. +// } - // // Codifica o conteúdo em uma string adequada para o QR Code. - // Future encodeContents() async { - // // Implementação específica para codificar o conteúdo. - // return data; // Exemplo simplificado. - // } +// // Codifica o conteúdo específico do QR Code. +// Future encodeQRCodeContents() async { +// return getQrCode(); +// } - // // Codifica o conteúdo específico do QR Code. - // Future encodeQRCodeContents() async { - // return getQrCode(); - // } +// // Gera o QR Code como um widget. - // // Gera o QR Code como um widget. - +// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). +// // Future encodeAsBitmap() async { +// // // Implementação para codificar como bitmap. +// // return Image(image); // Exemplo simplificado. +// // } - // // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). - // // Future encodeAsBitmap() async { - // // // Implementação para codificar como bitmap. - // // return Image(image); // Exemplo simplificado. - // // } +// // Adivinha a codificação apropriada para o conteúdo. +// String guessAppropriateEncoding(String content) { +// // Implementação para adivinhar a codificação. +// return "UTF-8"; // Exemplo simplificado. +// } - // // Adivinha a codificação apropriada para o conteúdo. - // String guessAppropriateEncoding(String content) { - // // Implementação para adivinhar a codificação. - // return "UTF-8"; // Exemplo simplificado. - // } +// // Remove espaços em branco do início e do fim do conteúdo. +// String trim(String content) { +// return content.trim(); +// } - // // Remove espaços em branco do início e do fim do conteúdo. - // String trim(String content) { - // return content.trim(); - // } +// // Escapa caracteres especiais para o formato MECARD. +// String escapeMECARD(String content) { +// // Implementação para escapar caracteres. +// return content.replaceAll(':', '\\:'); // Exemplo simplificado. +// } - // // Escapa caracteres especiais para o formato MECARD. - // String escapeMECARD(String content) { - // // Implementação para escapar caracteres. - // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } +/// menu - /// menu - - Future scheduleVisitOptAction(BuildContext context) async { - await showAdaptiveDialog( - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'scheduleCompleteVisitPage', - 'scheduleProvisionalVisitPage', - 'fastPassPage', - ], - iconsListIcon: [ - Icons.date_range_rounded, - Icons.date_range_rounded, - Icons.date_range_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nCompleta', - enText: 'Complete\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nProvisória', - enText: 'Provisional\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nRápida', - enText: 'Fast\nSchedule', - ), - ], - ), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, +Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], ), - }, - ); - } + ); + }, + ); +} - Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, +Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], ), - }, - ); - } + ); + }, + ); +} - Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future liberationHistoryOptAction(BuildContext context) async { - await showAdaptiveDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'liberationHistory', - 'acessHistoryPage', - 'scheduleCompleteVisitPage', - // 'messageHistoryPage', - ], - iconsListIcon: [ - Icons.history_rounded, - Icons.history_rounded, - Icons.history_rounded, - // Icons.history_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Liberação', - enText: 'Liberation\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Acesso', - enText: 'Access\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Visita', - enText: 'Visit\nHistory', - ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), - ], - ), - ); - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } \ No newline at end of file +Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} diff --git a/lib/app_state.dart b/lib/app_state.dart index 917fb812..115951d0 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -17,7 +17,7 @@ class FFAppState extends ChangeNotifier { // Verifica suporte biométrico Future checkBiometrics() async { try { - return await auth.canCheckBiometrics; + return await auth.canCheckBiometrics; } catch (e) { clearBiometricAuthentication(); debugPrint('Error checking biometrics: $e'); @@ -30,14 +30,13 @@ class FFAppState extends ChangeNotifier { bool authenticated = false; try { authenticated = await auth.authenticate( - localizedReason: 'Scan your fingerprint to authenticate', - options: const AuthenticationOptions( - biometricOnly: true, - stickyAuth: true, - useErrorDialogs: true, - sensitiveTransaction: true, - ) - ); + localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions( + biometricOnly: true, + stickyAuth: true, + useErrorDialogs: true, + sensitiveTransaction: true, + )); if (authenticated) { _isBiometricAuthenticated = true; notifyListeners(); @@ -50,7 +49,8 @@ class FFAppState extends ChangeNotifier { clearBiometricAuthentication(); return Future.error(e); } - return Future.error(''); // Add this line to ensure a value is always returned + return Future.error( + ''); // Add this line to ensure a value is always returned } // Função para limpar o estado de autenticação biométrica @@ -60,9 +60,6 @@ class FFAppState extends ChangeNotifier { // Limpar a informação salva, se necessário } - - - static FFAppState _instance = FFAppState._internal(); factory FFAppState() { @@ -123,13 +120,16 @@ class FFAppState extends ChangeNotifier { _tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS; }); await _safeInitAsync(() async { - _userDevUUID = await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; + _userDevUUID = + await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; }); await _safeInitAsync(() async { - _serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber; + _serialNumber = + await secureStorage.getString('ff_serialNumber') ?? _serialNumber; }); await _safeInitAsync(() async { - _fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; + _fingerprintOPT = + await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; }); await _safeInitAsync(() async { _personOPT = await secureStorage.getBool('person') ?? _personOPT; @@ -137,6 +137,9 @@ class FFAppState extends ChangeNotifier { await _safeInitAsync(() async { _passOPT = await secureStorage.getBool('pass') ?? _passOPT; }); + await _safeInitAsync(() async { + _panicOPT = await secureStorage.getBool('panic') ?? _panicOPT; + }); await _safeInitAsync(() async { _notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT; }); @@ -147,9 +150,9 @@ class FFAppState extends ChangeNotifier { _panicPass = await secureStorage.getString('panicPass') ?? _panicPass; }); await _safeInitAsync(() async { - _fingerprintPass = await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; + _fingerprintPass = + await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; }); - } void update(VoidCallback callback) { @@ -159,6 +162,17 @@ class FFAppState extends ChangeNotifier { late FlutterSecureStorage secureStorage; + bool _panicOPT = false; + bool get panic => _panicOPT; + set panic(bool value) { + _panicOPT = value; + secureStorage.setBool('panic', value); + } + + void deletePanic() { + secureStorage.delete(key: 'panic'); + } + String _fingerprintPass = ''; String get fingerprintPass => _fingerprintPass; set fingerprintPass(String value) { @@ -185,8 +199,7 @@ class FFAppState extends ChangeNotifier { String get panicPass => _panicPass; set panicPass(String value) { _panicPass = value; - secureStorage.setString - ('panicPass', value); + secureStorage.setString('panicPass', value); } void deletePanicPass() { @@ -203,8 +216,7 @@ class FFAppState extends ChangeNotifier { bool _passOPT = false; bool get pass => _passOPT; set pass(bool value) { - _passOPT = - value; + _passOPT = value; secureStorage.setBool('pass', value); } @@ -486,4 +498,4 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage { Future setStringList(String key, List value) async => await writeSync( key: key, value: const ListToCsvConverter().convert([value])); -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index 95333ddd..22686297 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -134,7 +134,7 @@ class _ThrowExceptionWidgetState extends State ), Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + const EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: Text( valueOrDefault( widget.msg, @@ -150,6 +150,7 @@ class _ThrowExceptionWidgetState extends State FlutterFlowTheme.of(context) .bodyMediumFamily), ), + textAlign: TextAlign.left, ), ), ].addToStart(const SizedBox(height: 50.0)), @@ -162,4 +163,4 @@ class _ThrowExceptionWidgetState extends State ], ); } -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 421d595f..783d3801 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,16 +1,13 @@ - import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; - import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; - class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({super.key}); @@ -65,7 +62,8 @@ class _VisitorNotFoundComponentWidgetState Align( alignment: const AlignmentDirectional(1.0, -1.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -87,7 +85,8 @@ class _VisitorNotFoundComponentWidgetState size: 72.0, ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( '1p9mykbj' /* Usuário não encontrado */, @@ -102,7 +101,8 @@ class _VisitorNotFoundComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), child: Text( FFLocalizations.of(context).getText( 'kt937sp6' /* O documento inserido não corre... */, @@ -128,12 +128,19 @@ class _VisitorNotFoundComponentWidgetState await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, - enableDrag: false, + enableDrag: true, + useSafeArea: true, context: context, builder: (context) { return Padding( padding: MediaQuery.viewInsetsOf(context), - child: const RegisiterVistorTemplateComponentWidget(), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: + const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), ); }, ).then((value) => safeSetState(() {})); @@ -144,10 +151,10 @@ class _VisitorNotFoundComponentWidgetState options: FFButtonOptions( width: double.infinity, height: 30.0, - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: @@ -177,4 +184,4 @@ class _VisitorNotFoundComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart index 156672de..d2ec0caa 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -12,7 +12,6 @@ export 'forgot_password_template_component_model.dart'; // - class ForgotPasswordTemplateComponentWidget extends StatefulWidget { const ForgotPasswordTemplateComponentWidget({super.key}); @@ -49,186 +48,106 @@ class _ForgotPasswordTemplateComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + return GestureDetector( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 300.0, + constraints: const BoxConstraints( + maxWidth: 570.0, ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Outfit'), + ), ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText( - 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -237,82 +156,173 @@ class _ForgotPasswordTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), ), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '74rnd5bu' /* Enviar */, - ), - options: FFButtonOptions( - width: 270.0, - height: 50.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: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'mtz8l7ft' /* Email */, + ), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + hintText: FFLocalizations.of(context).getText( + 'w7y5wlnv' /* digite o seu email..... */, + ), + hintStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent3, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, + color: FlutterFlowTheme.of(context).primaryText, + 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, - ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: const Color(0xFF6F61EF), + validator: _model.emailAddressTextControllerValidator + .asValidator(context), ), - showLoadingIndicator: false, ), ), - ), - ], + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); + + if (PhpGroup.forgotPasswordCall.error( + (_model.req?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.forgotPasswordCall.msg( + (_model.req?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + '74rnd5bu' /* Enviar */, + ), + options: FFButtonOptions( + width: 270.0, + height: 50.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: const Color(0xFF1AAB5F), + textStyle: + FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: 16.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, + ), + ), + showLoadingIndicator: false, + ), + ), + ), + ], + ), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index e0f842b7..f0fffd4e 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,17 +1,15 @@ - -import 'dart:typed_data'; - +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; import 'package:flutter/material.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; -import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/form_field_controller.dart'; -import 'package:hub/flutter_flow/uploaded_file.dart'; + +import 'regisiter_vistor_template_component_widget.dart'; class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { - /// State fields for stateful widgets in this component. + /// State fields for stateful widgets in this page. + final unfocusNode = FocusNode(); bool isDataUploading = false; FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); @@ -20,31 +18,98 @@ class RegisiterVistorTemplateComponentModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + // State field(s) for DropDown widget. + String? dropDownValue; + FormFieldController? dropDownValueController; // State field(s) for TextField widget. FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + // State field(s) for TextField widget. FocusNode? textFieldFocusNode4; TextEditingController? textController4; String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + if (!val.contains('@') || !val.contains('.')) { + return FFLocalizations.of(context).getVariableText( + enText: 'Invalid email', + ptText: 'Email inválido', + ); + } + return null; + } + // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. String? imgBase64; // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? registerVisitor; + ApiCallResponse? scheduleVisitor; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } @override void dispose() { + unfocusNode.dispose(); textFieldFocusNode1?.dispose(); textController1?.dispose(); @@ -58,4 +123,3 @@ class RegisiterVistorTemplateComponentModel textController4?.dispose(); } } - diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 2ea62d9b..2b541bf5 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,28 +1,27 @@ +import 'dart:developer'; -import 'dart:typed_data'; +import 'package:flutter/services.dart'; +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_drop_down.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/flutter_flow/form_field_controller.dart'; +import '/flutter_flow/upload_data.dart'; +import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart'; -import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; -import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.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/form_field_controller.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; -import 'package:hub/flutter_flow/upload_data.dart'; -import 'package:hub/flutter_flow/uploaded_file.dart'; import 'package:provider/provider.dart'; - - +import 'regisiter_vistor_template_component_model.dart'; +export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { - const RegisiterVistorTemplateComponentWidget({super.key}); + final String source; + + const RegisiterVistorTemplateComponentWidget( + {super.key, required this.source}); @override State createState() => @@ -33,11 +32,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State { late RegisiterVistorTemplateComponentModel _model; - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } + final scaffoldKey = GlobalKey(); @override void initState() { @@ -60,7 +55,7 @@ class _RegisiterVistorTemplateComponentWidgetState @override void dispose() { - _model.maybeDispose(); + _model.dispose(); super.dispose(); } @@ -68,10 +63,14 @@ class _RegisiterVistorTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - + log(context + .describeWidget('RegisiterVistorTemplateComponentWidget') + .toString()); return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( + width: double.infinity, + height: double.infinity, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -81,33 +80,14 @@ class _RegisiterVistorTemplateComponentWidgetState topRight: Radius.circular(25.0), ), ), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 30.0, 0.0, 0.0), - child: SingleChildScrollView( + child: SingleChildScrollView( + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.disabled, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 20.0), - child: Text( - FFLocalizations.of(context).getText( - 'wnhkedzt' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w800, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ), Builder( builder: (context) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { @@ -129,7 +109,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.uploadedLocalFile.bytes ?? Uint8List.fromList([]), width: 300.0, - height: 100.0, + height: 200.0, fit: BoxFit.cover, ), ), @@ -171,7 +151,7 @@ class _RegisiterVistorTemplateComponentWidgetState bytes: m.bytes, height: m.dimensions?.height, width: m.dimensions?.width, - blurHash: m.blurHash, + // blurHash: m.blurHash, )) .toList(); } finally { @@ -205,8 +185,9 @@ class _RegisiterVistorTemplateComponentWidgetState height: 80.0, padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), color: FlutterFlowTheme.of(context) .primaryBackground, textStyle: FlutterFlowTheme.of(context) @@ -238,7 +219,7 @@ class _RegisiterVistorTemplateComponentWidgetState 0.0, 50.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'kpd31z4d' /* Clique para adicionar a foto p... */, + 'p4ftwxcy' /* Clique para adicionar a foto p... */, ), style: FlutterFlowTheme.of(context) .bodyMedium @@ -264,11 +245,11 @@ class _RegisiterVistorTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'q986vs4m' /* Preencha o formulário com os d... */, + 'zazj5d8b' /* Preencha o formulário com os d... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -282,16 +263,19 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, focusNode: _model.textFieldFocusNode1, autofocus: false, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'llcw2tei' /* Nome */, + 'v7g73yik' /* Nome */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -315,7 +299,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -360,105 +344,23 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController1Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration(), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '67ykbznt' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 20.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'ugjkeiz7' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '8nlk5xlk' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 48.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'kw07i43y' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).accent1, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 4.0, 16.0, 4.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ], - ), - ), - ), - ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - '96ayre48' /* Documento */, + 'rl8tvwnr' /* Documento */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -481,7 +383,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -522,16 +424,135 @@ class _RegisiterVistorTemplateComponentWidgetState ), validator: _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), + ), + ], + ), ), ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'j0g7ggs2' /* Contatos */, + 'bqpucwh0' /* Contatos */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -545,16 +566,24 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.next, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[0-9, +, -, (, )]')), + ], obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'ybdjabnd' /* Telefone */, + 'h84ls2r6' /* Telefone */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -578,7 +607,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -617,21 +646,24 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), - validator: - _model.textController3Validator.asValidator(context), + // validator: + // _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsets.all(24.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.done, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'tlr6uxo4' /* Email */, + 'fqp7qmka' /* Email */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -655,7 +687,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -695,135 +727,199 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), keyboardType: TextInputType.emailAddress, - validator: - _model.textController4Validator.asValidator(context), + // validator: + // _model.textController4Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.registerVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: (_model.dropDownValue == 'Visitante') || - (_model.dropDownValue == 'Visitor') - ? 'V' - : 'P', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.registerVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.registerVisitor?.jsonBody ?? ''), - )}', - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( context: context, builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clearComposing(); + _model.textController2?.clearComposing(); + _model.textController3?.clearComposing(); + _model.textController4?.clearComposing(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + if (widget.source == 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitorCall + .errorMsg(_model + .scheduleVisitor?.jsonBody) + .toString()), + ), ), ); }, ).then((value) => safeSetState(() {})); } + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () { + Form.of(context)?.validate(); + Navigator.pop(context); + }, + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '65puvap9' /* Cadastrar */, + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, + ), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, ), - options: FFButtonOptions( - width: double.infinity, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)) + .addToEnd(const SizedBox(height: 30.0)), ), ), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart index fd542965..e1010ec7 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -8,6 +8,7 @@ class SignInTemplateComponentModel /// State fields for stateful widgets in this component. final formKey = GlobalKey(); + final unfocusNode = FocusNode(); // State field(s) for emailAddress widget. FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index ae8cc9df..3f5d1c36 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -113,8 +115,8 @@ class _SignInTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 35.0, 0.0, 35.0), child: Container( width: 548.0, height: 112.0, @@ -130,7 +132,8 @@ class _SignInTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: + const AlignmentDirectional(0.0, 1.0), child: Padding( padding: const EdgeInsets.all(3.0), child: Text( @@ -210,8 +213,9 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -223,7 +227,8 @@ class _SignInTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.emailAddressTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: true, @@ -351,8 +356,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -364,7 +370,8 @@ class _SignInTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.passwordTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: true, @@ -417,7 +424,8 @@ class _SignInTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -428,7 +436,8 @@ class _SignInTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -439,7 +448,8 @@ class _SignInTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -514,16 +524,18 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && + onPressed: ((_model + .emailAddressTextController + .text == + '') && (_model.passwordTextController - .text == - '')) + .text == + '')) ? null : () async { await action_blocks @@ -548,18 +560,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -586,7 +592,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -605,8 +612,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: () async { @@ -624,18 +632,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -662,7 +664,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -687,20 +690,21 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: (((_model.emailAddressTextController - .text == - '') || + .text == + '') || ((_model.emailAddressFocusNode ?.hasFocus ?? false) != null)) && ((_model.emailAddressTextController + .text == + '') || + ((_model.passwordTextController .text == '') || - ((_model.passwordTextController.text == - '') || ((_model.passwordFocusNode?.hasFocus ?? false) != null)))) @@ -728,18 +732,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -767,7 +765,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -776,7 +775,8 @@ class _SignInTemplateComponentWidgetState BorderRadius .circular(12.0), disabledColor: - const Color(0xE81AAB5F), + const Color( + 0xE81AAB5F), ), showLoadingIndicator: false, @@ -788,7 +788,7 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: () async { await widget @@ -805,18 +805,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -844,7 +838,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -858,7 +853,8 @@ class _SignInTemplateComponentWidgetState ), ), ), - ].divide(const SizedBox(width: 7.0)), + ].divide( + const SizedBox(width: 7.0)), ); } }, @@ -866,8 +862,8 @@ class _SignInTemplateComponentWidgetState // You will have to add an action on this rich text to go to your login page. Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -879,14 +875,35 @@ class _SignInTemplateComponentWidgetState backgroundColor: Colors.transparent, enableDrag: false, + useSafeArea: true, context: context, builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), + return GestureDetector( + onTap: () => _model + .unfocusNode + .canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model + .unfocusNode) + : FocusScope.of(context) + .unfocus(), + child: SizedBox( + height: + MediaQuery.of(context) + .size + .height, + width: + MediaQuery.of(context) + .size + .width, + child: Padding( + padding: MediaQuery + .viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ), + ), ); }, ).then( diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 460ef502..6d8138cb 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,4 +1,3 @@ - import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; @@ -9,8 +8,6 @@ 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:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -69,171 +66,167 @@ class _VisitorSearchModalTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 300.0, 0.0, 0.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - onFieldSubmitted: (_) async { - setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); - _model.textController?.selection = - TextSelection.collapsed( - offset: _model.textController!.text.length); - }); - _model.getVisitorByDoc = - await PhpGroup.getVisitorByDocCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitante', - documento: _model.textController.text, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + onFieldSubmitted: (_) async { + setState(() { + _model.textController?.text = valueOrDefault( + _model.textController.text, + '69696777', ); + _model.textController?.selection = TextSelection.collapsed( + offset: _model.textController!.text.length); + }); + _model.getVisitorByDoc = + await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: _model.textController.text, + ); - if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { - _model - .addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + if (PhpGroup.getVisitorByDocCall.vistanteId( (_model.getVisitorByDoc?.jsonBody ?? ''), - )); - setState(() {}); - _model.addToDocs(_model.textController.text); - setState(() {}); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - } - + ) != + '0') { + _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + (_model.getVisitorByDoc?.jsonBody ?? ''), + )); setState(() {}); - }, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 'cjlpru1m' /* Procure pelo documento do visi... */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - '8i1qszba' /* test */, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - prefixIcon: Icon( - Icons.search_outlined, - color: FlutterFlowTheme.of(context).accent1, - ), + _model.addToDocs(_model.textController.text); + setState(() {}); + } else { + await showModalBottomSheet( + isScrollControlled: true, + enableDrag: true, + isDismissible: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const VisitorNotFoundComponentWidget(), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 'cjlpru1m' /* Procure pelo documento do visi... */, ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), + FlutterFlowTheme.of(context).labelMediumFamily), ), - keyboardType: TextInputType.number, - validator: - _model.textControllerValidator.asValidator(context), + hintText: FFLocalizations.of(context).getText( + '8i1qszba' /* test */, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + prefixIcon: Icon( + Icons.search_outlined, + color: FlutterFlowTheme.of(context).accent1, + ), ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + keyboardType: TextInputType.number, + validator: _model.textControllerValidator.asValidator(context), ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.length > 0) Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 12.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( '9coywebh' /* Visitantes encontrados */, @@ -249,12 +242,10 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ), Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 4.0, 12.0, 16.0, 0.0), child: Text( - FFLocalizations.of(context).getText( - '6f5p0fv6' /* 24 */, - ), + _model.visitors.length.toString(), style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, @@ -266,273 +257,270 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ], ), - Expanded( - child: Builder( - builder: (context) { - if (_model.visitors.isNotEmpty) { - return Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), - child: Builder( - builder: (context) { - final visitor = - _model.visitors.map((e) => e).toList(); + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = + _model.visitors.map((e) => e).toList(); - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: - BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 60.0, - height: 60.0, - fit: BoxFit.cover, + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: const SizedBox( + height: 610.0, + child: + VisitorDetailsModalTemplateComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 0.0, + color: FlutterFlowTheme.of(context) + .alternate, + offset: const Offset( + 0.0, + 1.0, + ), + ) + ], + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: + BorderRadius.circular(40.0), + child: CachedNetworkImage( + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), + width: 60.0, + height: 60.0, + fit: BoxFit.cover, ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(12.0, 0.0, - 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField( - visitorItem, - r'''$.VTE_NOME''', - )?.toString(), - 'NOT FOUND', - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyLargeFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyLargeFamily), - ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField( + visitorItem, + r'''$.VTE_NOME''', + )?.toString(), + 'NOT FOUND', ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyLargeFamily), + ), ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(4.0, 4.0, - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 4.0, 4.0, 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, -1.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: Text( + getJsonField( + visitorItem, + r'''$.VTE_TELEFONE''', + ).toString(), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .primary, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.restore_from_trash, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - _model.removeFromVisitors( - visitorItem); - setState(() {}); - }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.restore_from_trash, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, ), - ], - ), + onPressed: () async { + _model.removeFromVisitors( + visitorItem); + setState(() {}); + }, + ), + ], ), ), ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - ), - ); - } - }, - ), - ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), + ), + ); + }, + ); + }, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).secondaryBackground, + ), + ); + } + }, + ), + ), + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getText( + 'ug6qzyla' /* Adicionar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 30.0, + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.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: FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), ), ), - ], - ), + ), + ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index e66e26b7..8a3cc1be 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -13,7 +13,6 @@ import 'package:url_launcher/url_launcher.dart'; import '../main.dart'; - export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; export 'place.dart'; @@ -87,6 +86,46 @@ Theme wrapInMaterialDatePickerTheme( return Theme( data: baseTheme.copyWith( + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), colorScheme: baseTheme.colorScheme.copyWith( onSurface: pickerForegroundColor, ), @@ -149,9 +188,54 @@ Theme wrapInMaterialTimePickerTheme( final baseTheme = Theme.of(context); return Theme( data: baseTheme.copyWith( + focusColor: headerBackgroundColor, iconTheme: baseTheme.iconTheme.copyWith( size: iconSize, ), + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + focusColor: headerBackgroundColor, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + outlineBorder: BorderSide( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( foregroundColor: WidgetStatePropertyAll( @@ -169,6 +253,7 @@ Theme wrapInMaterialTimePickerTheme( })), ), timePickerTheme: baseTheme.timePickerTheme.copyWith( + hourMinuteColor: selectedDateTimeBackgroundColor, backgroundColor: pickerBackgroundColor, hourMinuteTextColor: pickerForegroundColor, dialHandColor: selectedDateTimeBackgroundColor, @@ -574,4 +659,4 @@ double computeGradientAlignmentY(double evaluatedAngle) { y = sin(2 * rads); } return double.parse(roundTo(y, 2)); -} \ No newline at end of file +} diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 6955a811..6cf9f539 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -22,17 +22,11 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/home_page/home_page_model.dart'; - import 'package:provider/provider.dart'; - - class HomePageWidget extends StatefulWidget { const HomePageWidget({super.key}); - - - @override State createState() => _HomePageWidgetState(); } @@ -42,7 +36,6 @@ class _HomePageWidgetState extends State { bool localStatus = false; final scaffoldKey = GlobalKey(); - Future checkLocalStatus() async { localStatus = await checkLocals( context: context, @@ -57,9 +50,6 @@ class _HomePageWidgetState extends State { _model = createModel(context, () => HomePageModel()); SchedulerBinding.instance.addPostFrameCallback((_) async { await PushNotificationService().initialize(context); - - - @override void initState() { @@ -105,7 +95,6 @@ class _HomePageWidgetState extends State { @override Widget build(BuildContext context) { - context.watch(); return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus @@ -122,523 +111,485 @@ class _HomePageWidgetState extends State { Container buildPage(BuildContext context, bool localStatus) { return Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + createHeader(context), + createLocal(localStatus), + createBody(), + ], + ), + ], ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - createHeader(context), - createLocal(localStatus), - createBody(), - ], - ), - ], - ), - ), - ); + ), + ); } Wrap createBody() { return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget( - expandable: true, - style: MenuView.list_grid, - item: MenuItem.button, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Provider( - create: (_) => MessageWellNotifier(), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ), - //footer - const SizedBox( - height: 100, - width: double.infinity, - ) - ], - ); + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget( + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Provider( + create: (_) => MessageWellNotifier(), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ), + //footer + const SizedBox( + height: 100, + width: double.infinity, + ) + ], + ); } Widget createLocal(bool localStatus) { return wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: LocalProfileComponentWidget( - localStatus: localStatus, - ), - ); + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: LocalProfileComponentWidget( + localStatus: localStatus, + ), + ); } Row createHeader(BuildContext context) { return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState!.openDrawer(); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, ), ), ), - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ), ), ), - ], - ), + ), + ], ), ), - ], - ); + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ); } SizedBox buildDrawer(BuildContext context) { return SizedBox( - width: 750.0, - child: Drawer( - elevation: 16.0, - child: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - shape: BoxShape.rectangle, + width: 750.0, + child: Drawer( + elevation: 16.0, + child: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Container( - width: double.infinity, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Container( + width: double.infinity, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), - Container( - width: 150.0, - child: Text( - valueOrDefault( - convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito Sans'), - ), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), + fit: BoxFit.cover, ), - ].divide(const SizedBox(width: 20.0)), - ), + ), + Container( + width: 150.0, + child: Text( + valueOrDefault( + convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito Sans'), + ), + ), + ), + ].divide(const SizedBox(width: 20.0)), ), ), - Container( - width: 50.0, - child: Container( - height: 30.0, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Flexible( - child: FlutterFlowIconButton( - borderRadius: 100.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close_sharp, - color: FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - if (scaffoldKey.currentState! - .isDrawerOpen || - scaffoldKey.currentState! - .isEndDrawerOpen) { - Navigator.pop(context); - } - }, + ), + Container( + width: 50.0, + child: Container( + height: 30.0, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: FlutterFlowIconButton( + borderRadius: 100.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close_sharp, + color: FlutterFlowTheme.of(context) + .primary, + size: 20.0, ), + onPressed: () async { + if (scaffoldKey + .currentState!.isDrawerOpen || + scaffoldKey.currentState! + .isEndDrawerOpen) { + Navigator.pop(context); + } + }, ), - ], - ), + ), + ], ), ), - ] - .divide(const SizedBox(width: 0.0)) - .around(const SizedBox(width: 0.0)), - ), + ), + ] + .divide(const SizedBox(width: 0.0)) + .around(const SizedBox(width: 0.0)), ), - ].addToStart(const SizedBox(height: 30.0)), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), ), - validator: _model.textControllerValidator - .asValidator(context), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).customColor1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), ), ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Expanded( - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - expandable: false, - style: MenuView.list, - item: MenuItem.card, - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, ), - borderRadius: BorderRadius.circular(50.0), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), + ), + Expanded( + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.card, ), ), - - ].addToEnd(const SizedBox(height: 64.0)), ), - ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), ), - ); + ), + ), + ); // body: Container( // decoration: BoxDecoration( @@ -836,6 +787,5 @@ class _HomePageWidgetState extends State { // ), // ), // ); - } } diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 4668af2e..cac62056 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -1,94 +1,159 @@ - import 'dart:developer'; - - import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:flutter/material.dart'; import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:share_plus/share_plus.dart'; class PreferencesPageModel with ChangeNotifier { final unfocusNode = FocusNode(); - Future toggleFingerprint(BuildContext context) async { - // FFAppState().checkBiometrics() // .then((value) => FFAppState().authenticateBiometric() // .then( (value) { // FFAppState().fingerprint = !FFAppState().fingerprint; - + // }) // .whenComplete(() => notifyListeners())); - if(FFAppState().fingerprint) { + if (FFAppState().fingerprint) { FFAppState().fingerprint = false; FFAppState().deleteFingerprintPass(); notifyListeners(); } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - log(key); - FFAppState().fingerprintPass = key; - FFAppState().fingerprint = true; - }, - ), - ); - }, - ).whenComplete(() => notifyListeners()); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + log(key); + FFAppState().fingerprintPass = key; + FFAppState().fingerprint = true; + }, + ), + ); + }, + ).whenComplete(() => notifyListeners()); } - } void enablePerson(BuildContext context) { - notifyListeners(); ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(FFAppState().userDevUUID, style: TextStyle(color: FlutterFlowTheme.of(context).info) ), + SnackBar( + content: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(FFAppState().userDevUUID, + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.share, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + // Implement share functionality here + Share.share( + FFAppState().userDevUUID, + ); + }, + ), + ], + ), backgroundColor: FlutterFlowTheme.of(context).primary, duration: const Duration(seconds: 1), behavior: SnackBarBehavior.floating, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30), - ), + ), ), ); } - void toggleNotify() { + void toggleNotify(BuildContext context) { FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica.call( + PhpGroup.changeNotifica + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, atividade: 'updVisitado', notifica: FFAppState().notify ? 'S' : 'N', - ); + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); notifyListeners(); } - void localLogout(){ - PhpGroup.resopndeVinculo.call( + void localUnlink(BuildContext context) { + PhpGroup.resopndeVinculo + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, tarefa: 'I', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + }, ); notifyListeners(); } @@ -108,57 +173,99 @@ class PreferencesPageModel with ChangeNotifier { ); } - - Future togglePass(BuildContext context) async { + Future togglePass(BuildContext context) async { debugPrint('pass: ${FFAppState().pass}'); - if(FFAppState().pass) { + if (FFAppState().pass) { FFAppState().pass = false; FFAppState().deleteAccessPass(); notifyListeners(); } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().accessPass = key; + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().accessPass = key; notifyListeners(); debugPrint('key: $key'); - await PhpGroup.changePass.call( + await PhpGroup.changePass + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, atividade: 'updVisitado', newSenha: FFAppState().accessPass, ) - .then((value) { + .then((value) { FFAppState().pass = true; // var error = jsonDecode(value.jsonBody['error'].toString()); // log('${jsonDecode(value.jsonBody['error'].toString())}'); - if(jsonDecode(value.jsonBody['error'].toString()) == false) { + if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; } else { FFAppState().pass = false; } - }) - .onError((error, StackTrace) { - FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); - }) - .whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); + }).onError((error, StackTrace) { + FFAppState().pass = false; + log(error.toString()); + log(StackTrace.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + Future togglePanic(BuildContext context) async { + if (FFAppState().panic) { + FFAppState().panic = false; + FFAppState().deletePanicPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().panicPass = key; + notifyListeners(); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().panicPass, + ) + .then((value) { + FFAppState().panic = true; + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().panic = true; + } else { + FFAppState().panic = false; + } + }).onError((e, s) { + FFAppState().panic = false; + log(e.toString()); + log(s.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); } } @@ -167,4 +274,4 @@ class PreferencesPageModel with ChangeNotifier { unfocusNode.dispose(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index f2173bfd..8a036ed9 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -9,7 +9,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; - class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -46,7 +45,7 @@ class PreferencesPageWidget extends StatelessWidget { FFLocalizations.of(context).getVariableText( enText: 'Preferences', ptText: 'Preferências', - ), + ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -74,7 +73,7 @@ class PreferencesPageWidget extends StatelessWidget { // childAspectRatio: 1.0, // mainAxisExtent: 100.0, // ), - itemCount: 6, // 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) { @@ -90,82 +89,110 @@ class PreferencesPageWidget extends StatelessWidget { ); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + Widget _buildIconButton( + BuildContext context, int index, PreferencesPageModel model) { IconData icon; - Function() onPressed =() => {}; + Function() onPressed = () => {}; bool isEnabled; String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + onPressed = () => + model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative a autenticação por impressão digital para login seguro.', + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Ative a autenticação por impressão digital para login seguro.', enText: 'Enable fingerprint authentication for secure login.', - ); + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Exibir código de identificação remota', enText: 'Display remote identification code', - ); + ); break; case 2: icon = Icons.notifications; - onPressed = model.toggleNotify; + onPressed = () => model.toggleNotify(context); isEnabled = FFAppState().notify; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para receber sua notificação de acesso', enText: 'Enable to receive your access notification', - ); + ); break; case 3: - icon = Icons.lock_clock_sharp; + icon = Icons.lock; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para inserir uma credencial de acesso para o QRCode', enText: 'Enable to enter an access credential for the QRCode', - ); + ); break; case 4: - icon = Icons.landscape; - onPressed = model.localLogout; - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para se desvincular do local selecionado', - enText: 'Enable to unlink from the selected location', - ); + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().panic; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de pânico para o QRCode', + enText: 'Enable to enter an panic credential for the QRCode', + ); break; case 5: + icon = Icons.landscape; + onPressed = () => model.localUnlink(context); + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Desative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 6: icon = Icons.delete; onPressed = () => model.deleteAccount(context); - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Delete sua conta e todos os dados associados permanentemente.', + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Delete sua conta e todos os dados associados permanentemente.', enText: 'Delete your account and all associated data permanently.', - ); + ); break; default: throw Exception('Invalid index: $index'); } - return Container( + return SizedBox( height: 100, child: GestureDetector( - onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + onTap: () { + switch (index) { + case 3: + model.togglePass(context); + break; + case 4: + model.togglePanic(context); + break; + default: + onPressed(); + } + }, child: Row( children: [ CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + backgroundColor: isEnabled + ? FlutterFlowTheme.of(context).primary + : FlutterFlowTheme.of(context).alternate, child: Icon( icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + color: isEnabled + ? FlutterFlowTheme.of(context).primaryBackground + : FlutterFlowTheme.of(context).primary, // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, // borderRadius: 20.0, @@ -181,13 +208,13 @@ class PreferencesPageWidget extends StatelessWidget { child: Text( content, style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), overflow: TextOverflow.clip, ), ), @@ -196,4 +223,4 @@ class PreferencesPageWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 7c216c8d..85e15627 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -1,3 +1,5 @@ +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; @@ -8,108 +10,12 @@ class RegisterVisitorPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - String? _textController1Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - String? _textController2Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - String? _textController3Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - String? _textController4Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? scheduleVisitor; + late RegisiterVistorTemplateComponentModel + regisiterVistorTemplateComponentModel; @override - void initState(BuildContext context) { - - textFieldFocusNode1 = FocusNode(); - textController1 = TextEditingController(); - textController1Validator = _textController1Validator; - - textFieldFocusNode2 = FocusNode(); - textController2 = TextEditingController(); - textController2Validator = _textController2Validator; - - - dropDownValue = ''; - // dropDownValueController = FormFieldController(initialValue: dropDownValue); - - textFieldFocusNode3 = FocusNode(); - textController3 = TextEditingController(); - textController3Validator = _textController3Validator; - - textFieldFocusNode4 = FocusNode(); - textController4 = TextEditingController(); - textController4Validator = _textController4Validator; - } + void initState(BuildContext context) {} @override - void dispose() { - unfocusNode.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} \ No newline at end of file + void dispose() {} +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index ea48ca5f..67eae017 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,17 +1,10 @@ -import 'package:hub/flutter_flow/nav/nav.dart'; - -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; -import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'register_visitor_page_model.dart'; export 'register_visitor_page_model.dart'; @@ -33,18 +26,6 @@ class _RegisterVisitorPageWidgetState extends State { void initState() { super.initState(); _model = createModel(context, () => RegisterVisitorPageModel()); - - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(); - _model.textFieldFocusNode4 ??= FocusNode(); } @override @@ -57,878 +38,46 @@ class _RegisterVisitorPageWidgetState extends State { @override Widget build(BuildContext context) { context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'megskb6s' /* Cadastro Visitante */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: SingleChildScrollView( - child: Form( - // key: UniqueKey(), - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath - .split('/') - .last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Column( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - if (_model.dropDownValue == null || - _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text(FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ), - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - color: FlutterFlowTheme.of(context).error, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodySmallFamily), - )), - ), - ], - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ).onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context).getVariableText( - ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ); - }); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg:FFLocalizations.of(context).getVariableText( - ptText: 'Erro ao cadastrar visitante. Tente novamente.', - enText: 'Error registering visitor. Try again.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context).getVariableText( - ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), - ), - ), - ), - ), + title: Text( + FFLocalizations.of(context).getText( + 'megskb6s' /* Cadastro Visitante */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), ), + actions: const [], + centerTitle: true, + elevation: 0.0, ), + body: const SafeArea( + top: true, + child: RegisiterVistorTemplateComponentWidget( + source: 'RegisterVisitorPage', + )), ); } -} \ No newline at end of file +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index f5192ee5..1551cf20 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -4,7 +4,6 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/request_manager.dart'; - import 'package:flutter/material.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; @@ -51,6 +50,7 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + DateTime? datePicked1; // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; @@ -107,4 +107,4 @@ class ScheduleCompleteVisitPageModel return false; } -} \ No newline at end of file +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 8b684610..81708039 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1,6 +1,5 @@ import 'dart:developer'; - import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -24,7 +23,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; - class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ super.key, @@ -111,7 +109,7 @@ class _ScheduleCompleteVisitPageWidgetState // Simulate fetching data from an API or database Future> fetchVisitHistory(int start, int limit) async { // Simulate network delay - await Future.delayed(Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); // Generate a list of visit history items return List.generate(limit, (index) => "Item ${start + index}"); } @@ -163,7 +161,6 @@ class _ScheduleCompleteVisitPageWidgetState } } - PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -315,8 +312,8 @@ Widget scheduleVisit( padding: const EdgeInsets.fromLTRB( 0, 0, - 0, - 20.0, + 20, + 20, ), shrinkWrap: true, scrollDirection: Axis.vertical, @@ -362,14 +359,16 @@ Widget scheduleVisit( setState(() {}); }, child: Container( - width: 100.0, + width: MediaQuery.of(context).size.width, height: 70.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, + .primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Container( width: 50.0, @@ -393,57 +392,35 @@ Widget scheduleVisit( fit: BoxFit.cover, ), ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_TIPO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), ] .divide(const SizedBox(width: 30.0)) .addToStart( @@ -466,10 +443,11 @@ Widget scheduleVisit( onPressed: () async { await showModalBottomSheet( isScrollControlled: true, + isDismissible: true, backgroundColor: FlutterFlowTheme.of(context) .primaryBackground, - enableDrag: false, + enableDrag: true, context: context, builder: (context) { return GestureDetector( @@ -480,25 +458,34 @@ Widget scheduleVisit( _model.unfocusNode) : FocusScope.of(context) .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, + child: SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.9, + width: MediaQuery.of(context) + .size + .width, + child: Padding( + padding: MediaQuery.viewInsetsOf( + context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: + (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), ), ), ); @@ -801,7 +788,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -822,7 +809,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked1Time; if (datePicked1Date != null) { datePicked1Time = @@ -868,7 +855,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -890,7 +877,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { @@ -1125,7 +1112,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -1146,7 +1133,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked2Time; if (datePicked2Date != null) { datePicked2Time = @@ -1192,7 +1179,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -1214,7 +1201,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { @@ -1563,12 +1550,58 @@ Widget scheduleVisit( onChanged: (newValue) async { setState(() => _model.switchValue = newValue); }, + applyCupertinoTheme: false, + focusColor: + FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .alternate; + } + return FlutterFlowTheme.of(context) + .alternate; + }, + ), + hoverColor: FlutterFlowTheme.of(context) + .primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: + WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), activeColor: FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveTrackColor: - FlutterFlowTheme.of(context).customColor4, + activeTrackColor: FlutterFlowTheme.of(context) + .primaryBackground, + inactiveTrackColor: FlutterFlowTheme.of(context) + .primaryBackground, inactiveThumbColor: FlutterFlowTheme.of(context).error, ), @@ -1792,11 +1825,10 @@ Widget scheduleVisit( alignment: const AlignmentDirectional(0.0, 1.0), child: Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + )), ), ), ), @@ -1937,10 +1969,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -1972,8 +2004,8 @@ Widget visitHistory( }, child: Card( clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, + color: + FlutterFlowTheme.of(context).primaryBackground, elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), @@ -1983,7 +2015,7 @@ Widget visitHistory( height: 115.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, + .primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -2193,8 +2225,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if (( jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2220,9 +2252,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if ( - jsonToStr( - getJsonField( + } else if (jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2261,9 +2292,8 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if (( - jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2360,6 +2390,4 @@ Widget visitHistory( ), ), ); - - -} \ No newline at end of file +} From 14d2c2f19e2bd82a757e8584c561cd78bb9b0525 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 31 Jul 2024 12:00:25 -0300 Subject: [PATCH 09/72] fix message well, visitor register and preferences pages --- .../schedule_visit_detail_widget.dart | 101 +- ...siter_vistor_template_component_model.dart | 24 + ...iter_vistor_template_component_widget.dart | 922 +++--- .../view_visit_detail_widget.dart | 38 +- ...tails_modal_template_component_widget.dart | 358 +-- ...earch_modal_template_component_widget.dart | 230 +- .../message_history_page_model.dart | 12 +- .../message_history_page_widget.dart | 134 +- .../preferences_settings_model.dart | 37 +- .../preferences_settings_widget.dart | 4 +- .../schedule_complete_visit_page_model.dart | 93 +- .../schedule_complete_visit_page_widget.dart | 2676 ++++++++--------- 12 files changed, 2264 insertions(+), 2365 deletions(-) diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 935379ad..ad430d41 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -15,7 +15,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; - class ScheduleVisitDetailWidget extends StatefulWidget { const ScheduleVisitDetailWidget({ super.key, @@ -59,24 +58,22 @@ class _ScheduleVisitDetailWidgetState extends State { super.initState(); _model = createModel(context, () => ScheduleVisitDetailModel()); - _model.textController1 ??= - TextEditingController(text: widget.visitTempStr); + _model.textController1 ??= TextEditingController(text: widget.visitTempStr); _model.textFieldFocusNode1 ??= FocusNode(); _model.textController2 ??= TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); - _model.textController4 ??= TextEditingController( - text: extractDescToStr(widget.visitResonStr!)); + _model.textController4 ??= + TextEditingController(text: extractDescToStr(widget.visitResonStr!)); _model.textFieldFocusNode4 ??= FocusNode(); - _model.textController5 ??= TextEditingController( - text: extractDescToStr(widget.visitLevelStr!)); + _model.textController5 ??= + TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -132,8 +129,8 @@ class _ScheduleVisitDetailWidgetState extends State { child: Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -192,41 +189,47 @@ class _ScheduleVisitDetailWidgetState extends State { BorderRadius.circular(100.0), ), child: Align( - alignment: - const AlignmentDirectional(1.0, -1.0), + alignment: const AlignmentDirectional( + 1.0, -1.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: + // Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf( + // context), + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => + // safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), imageUrl: valueOrDefault( "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( @@ -352,8 +355,9 @@ class _ScheduleVisitDetailWidgetState extends State { children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -459,8 +463,9 @@ class _ScheduleVisitDetailWidgetState extends State { ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -576,8 +581,9 @@ class _ScheduleVisitDetailWidgetState extends State { children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -683,8 +689,9 @@ class _ScheduleVisitDetailWidgetState extends State { ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController5, focusNode: _model.textFieldFocusNode5, @@ -905,7 +912,8 @@ class _ScheduleVisitDetailWidgetState extends State { Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), child: Container( width: double.infinity, height: 35.0, @@ -934,8 +942,7 @@ class _ScheduleVisitDetailWidgetState extends State { dtInicio: widget.visitStartDate, dtFim: widget.visitEndDate, unica: widget.visitTempStr, - idMotivo: - extractIdToStr(widget.visitResonStr!), + idMotivo: extractIdToStr(widget.visitResonStr!), idNAC: extractIdToStr(widget.visitLevelStr!), obs: widget.visitObsStr, cliID: FFAppState().cliUUID, @@ -981,4 +988,4 @@ class _ScheduleVisitDetailWidgetState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index f0fffd4e..6e812792 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,3 +1,9 @@ +import 'dart:developer'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; @@ -25,6 +31,24 @@ class RegisiterVistorTemplateComponentModel ptText: 'Este campo é obrigatório', ); } + + return null; + } + + Future getVisitanteByDocument( + String document, BuildContext context) async { + final response = await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: document, + ); + log('${response.jsonBody}'); + if (response.jsonBody['visitante']['VTE_ID'] != '0' && + response.jsonBody['error'] != 'false') { + return true; + } return null; } diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 2b541bf5..b47c79ee 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,6 +1,9 @@ import 'dart:developer'; import 'package:flutter/services.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:json_path/fun_sdk.dart'; +import 'package:rxdart/rxdart.dart'; import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; @@ -15,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'regisiter_vistor_template_component_model.dart'; + export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { @@ -45,6 +49,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); + _model.textController2?.addListener(_onTextChanged); _model.textController3 ??= TextEditingController(); _model.textFieldFocusNode3 ??= FocusNode(); @@ -58,10 +63,17 @@ class _RegisiterVistorTemplateComponentWidgetState _model.dispose(); super.dispose(); + _model.textController2?.removeListener(_onTextChanged); + } + + void _onTextChanged() { + log('changed'); + setState(() {}); } @override Widget build(BuildContext context) { + BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); log(context .describeWidget('RegisiterVistorTemplateComponentWidget') @@ -83,11 +95,360 @@ class _RegisiterVistorTemplateComponentWidgetState child: SingleChildScrollView( child: Form( // key: UniqueKey(), - autovalidateMode: AutovalidateMode.disabled, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'zazj5d8b' /* Preencha o formulário com os d... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: + _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + FutureBuilder( + future: _model.textController2.text.isNotEmpty + ? _model.getVisitanteByDocument( + _model.textController2.text, context) + : null, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const SizedBox(); + } else if (snapshot.hasError || + snapshot.data == null || + snapshot.data == '') { + visitorAlreadyRegistered.add(true); + return const SizedBox(); + } else { + visitorAlreadyRegistered.add(false); + return _model.textController2.text.isEmpty + ? const SizedBox() + : Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + right: MediaQuery.sizeOf(context).width * + 0.1), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .error, + fontSize: 14.0, + letterSpacing: 0.0, + )), + ), + ], + ); + } + }, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'v7g73yik' /* Nome */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + maxLines: null, + keyboardType: TextInputType.name, + validator: + _model.textController1Validator.asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), + ), + ], + ), + ), + ), Builder( builder: (context) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { @@ -246,310 +607,7 @@ class _RegisiterVistorTemplateComponentWidgetState alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - autovalidateMode: AutovalidateMode.onUserInteraction, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController1Validator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autovalidateMode: AutovalidateMode.onUserInteraction, - autofocus: false, - textCapitalization: TextCapitalization.none, - autofillHints: const [AutofillHints.password], - keyboardType: TextInputType.number, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController2Validator.asValidator(context), - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')), - ], - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Column( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - if (_model.dropDownValue == null || - _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ), - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - color: FlutterFlowTheme.of(context) - .customColor6, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodySmallFamily), - )), - ), - ], - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), + 20.0, 10.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( 'bqpucwh0' /* Contatos */, @@ -735,155 +793,129 @@ class _RegisiterVistorTemplateComponentWidgetState padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: _model.dropDownValue == - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ) - ? 'V' - : 'P', - foto: 'base64;jpeg,${_model.imgBase64}', - ) - .onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) + ? () async { + log(visitorAlreadyRegistered.value.toString()); + if (visitorAlreadyRegistered.value == true) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context) + .info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + width: MediaQuery.of(context).size.width, + behavior: SnackBarBehavior.floating, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), ), ), - ), - ), - ); - }, - ); - }); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clearComposing(); - _model.textController2?.clearComposing(); - _model.textController3?.clearComposing(); - _model.textController4?.clearComposing(); - _model.dropDownValueController?.reset(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Visitante cadastrado com sucesso.', - enText: - 'Visitor successfully registered.'), - style: TextStyle( - color: - FlutterFlowTheme.of(context).info)), - backgroundColor: - FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - if (widget.source == 'VisitorNotFoundComponent') { - Navigator.pop(context); + ); + if (widget.source == + 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + return DialogUtil.error( + context, + PhpGroup.postScheduleVisitorCall + .errorMsg( + _model.scheduleVisitor?.jsonBody) + .toString()); + } + } else { + DialogUtil.error( + context, + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.', + enText: + 'Visitor already registered. Check if the document was filled in correctly.', + )); } - }); - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitorCall - .errorMsg(_model - .scheduleVisitor?.jsonBody) - .toString()), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () { - Form.of(context)?.validate(); - Navigator.pop(context); - }, - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, + } + : null, text: FFLocalizations.of(context).getText( 'okbw0aiu' /* Cadastrar */, ), options: FFButtonOptions( width: 250.0, height: 36.0, + disabledColor: FlutterFlowTheme.of(context).customColor6, padding: const EdgeInsetsDirectional.fromSTEB( 80.0, 0.0, 80.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index bea401b7..0b82c87a 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -101,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State { TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= @@ -212,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), @@ -870,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State { Share.share( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', ); - }, ), ], diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart index 5f29a6fe..307ba81b 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -6,7 +6,19 @@ import 'visitor_details_modal_template_component_model.dart'; export 'visitor_details_modal_template_component_model.dart'; class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitorDetailsModalTemplateComponentWidget({super.key}); + const VisitorDetailsModalTemplateComponentWidget( + {super.key, + required this.visitorImageURL, + required this.visitorName, + required this.visitorType, + required this.visitorPhone, + required this.visitorEmail}); + + final String? visitorImageURL; + final String? visitorName; + final String? visitorType; + final String? visitorPhone; + final String? visitorEmail; @override State createState() => @@ -50,20 +62,40 @@ class _VisitorDetailsModalTemplateComponentWidgetState color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: BorderRadius.circular(25.0), ), - child: Stack( + child: Column( + mainAxisSize: MainAxisSize.max, children: [ - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), + Container( + width: double.infinity, + height: 34.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryText, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 5.0, 15.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 24.0, + ), ), ), ), @@ -71,68 +103,99 @@ class _VisitorDetailsModalTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(0.0, -1.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 40.0, 20.0, 0.0), child: Container( decoration: const BoxDecoration( shape: BoxShape.rectangle, ), - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Column( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (widget.visitorImageURL != '' && + widget.visitorImageURL != null) + Container( + width: 100.0, + height: 100.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + widget.visitorImageURL!, + fit: BoxFit.cover, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + widget.visitorName ?? '', + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'hz7ivuqn' /* Tipo de Visitante */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, children: [ - Container( - width: 100.0, - height: 100.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), + Icon( + Icons.phone, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, ), Align( - alignment: const AlignmentDirectional(0.0, 0.0), + alignment: + const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( 20.0, 0.0, 20.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'kqzf7nx2' /* Nome do Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'hz7ivuqn' /* Tipo de Visitante */, + 'rwqn0det' /* (00) 0 0000-0000 */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) @@ -151,128 +214,67 @@ class _VisitorDetailsModalTemplateComponentWidgetState ), ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rwqn0det' /* (00) 0 0000-0000 */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.email, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '0wqbiekp' /* email@provider.etc */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), ], ), - ), - ], - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '0wqbiekp' /* email@provider.etc */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ], ), ), ), ), ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: double.infinity, + // height: 34.0, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryText, + // borderRadius: const BorderRadius.only( + // bottomLeft: Radius.circular(0.0), + // bottomRight: Radius.circular(0.0), + // topLeft: Radius.circular(0.0), + // topRight: Radius.circular(0.0), + // ), + // ), + // ), + // ), ], ), ), diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 6d8138cb..35b21ac6 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -47,12 +47,6 @@ class _VisitorSearchModalTemplateComponentWidgetState _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); - - WidgetsBinding.instance.addPostFrameCallback((_) => setState(() { - _model.textController?.text = FFLocalizations.of(context).getText( - 'oj12tamm' /* test */, - ); - })); } @override @@ -91,10 +85,7 @@ class _VisitorSearchModalTemplateComponentWidgetState focusNode: _model.textFieldFocusNode, onFieldSubmitted: (_) async { setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); + _model.textController?.text = _model.textController.text; _model.textController?.selection = TextSelection.collapsed( offset: _model.textController!.text.length); }); @@ -268,7 +259,6 @@ class _VisitorSearchModalTemplateComponentWidgetState builder: (context) { final visitor = _model.visitors.map((e) => e).toList(); - return ListView.builder( padding: EdgeInsets.zero, scrollDirection: Axis.vertical, @@ -284,39 +274,42 @@ class _VisitorSearchModalTemplateComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); + // await showModalBottomSheet( + // isScrollControlled: true, + // enableDrag: true, + // isDismissible: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: SizedBox( + // height: 610.0, + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitorItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // visitorEmail: '', + // visitorName: getJsonField( + // visitorItem, + // r'''$.VTE_NOME''', + // )?.toString(), + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: Container( width: 100.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], + .primaryBackground, ), child: Padding( padding: const EdgeInsets.all(8.0), @@ -333,13 +326,11 @@ class _VisitorSearchModalTemplateComponentWidgetState milliseconds: 500), fadeOutDuration: const Duration( milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", width: 60.0, height: 60.0, fit: BoxFit.cover, @@ -348,6 +339,8 @@ class _VisitorSearchModalTemplateComponentWidgetState Expanded( child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -382,58 +375,6 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ), ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 4.0, 4.0, 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), ], ), ), @@ -442,10 +383,10 @@ class _VisitorSearchModalTemplateComponentWidgetState borderWidth: 1.0, buttonSize: 40.0, icon: Icon( - Icons.restore_from_trash, + Icons.close, color: FlutterFlowTheme.of(context) - .primary, + .customColor6, size: 20.0, ), onPressed: () async { @@ -470,54 +411,65 @@ class _VisitorSearchModalTemplateComponentWidgetState width: 100.0, height: 100.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).secondaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, ), ); } }, ), ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.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: FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.1, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), + ], ), + const SizedBox( + height: 10.0, + ) ], ), ), diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/message_history_page/message_history_page_model.dart index 9a40e0c4..8d11df7b 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,15 +1,16 @@ +import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/request_manager.dart'; - import 'package:flutter/material.dart'; import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -class MessageHistoryPageModel extends FlutterFlowModel { +class MessageHistoryPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. - /// - + /// + //copyWith final unfocusNode = FocusNode(); @@ -49,9 +50,8 @@ class MessageHistoryPageModel extends FlutterFlowModel textController?.dispose(); tabBarController?.dispose(); - /// Dispose query cache managers for this widget. clearGetLiberationsCache(); } -} \ No newline at end of file +} diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 18cffa18..8d9d7d5c 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -12,7 +12,6 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/message_history_page/message_history_page_model.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -26,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -36,7 +36,7 @@ class _MessageHistoryPageWidgetState extends State wit super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); - _model.tabBarController = TabController( + _model.tabBarController = TabController( vsync: this, length: 3, initialIndex: 1, @@ -106,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) { ); } -Widget bodyMessage( - BuildContext context, MessageHistoryPageModel _model) { +Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, child: Column( @@ -155,33 +154,26 @@ Widget bodyMessage( }, ), ), - Expanded(child: TabBarView( - controller: _model.tabBarController, - children: [ - liberationDynamicListView(context, _model, 'P'), - liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'T'), - ] - )), + Expanded( + child: TabBarView(controller: _model.tabBarController, children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ])), ].addToStart(const SizedBox(height: 0)), ), ); } - - - Widget liberationDynamicListView( - BuildContext context, - MessageHistoryPageModel _model, - String DestIndex -) { + BuildContext context, MessageHistoryPageModel _model, String DestIndex) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getMessagesCall.call( + future: PhpGroup.getMessagesCall + .call( devUUID: FFAppState().devUUID.toString(), userUUID: FFAppState().userUUID.toString(), cliID: FFAppState().cliUUID.toString(), @@ -189,7 +181,8 @@ Widget liberationDynamicListView( pageSize: '100', pageNumber: '1', tipoDestino: DestIndex, - ).catchError((error) { + ) + .catchError((error) { log('Error: ${error.toString()}'); return Future.delayed(Duration(seconds: 1), () { return Center( @@ -217,8 +210,15 @@ Widget liberationDynamicListView( child: Text('Erro ao carregar mensagens'), ); } + final mensagens = snapshot.data!.jsonBody['mensagens']; + final totalRows = snapshot.data!.jsonBody['total_rows']; + if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { + return const Center( + child: Text('Nenhuma mensagem encontrada'), + ); + } return ListView.builder( - itemCount: snapshot.data!.jsonBody['total_rows'], + itemCount: totalRows, addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, @@ -234,8 +234,7 @@ Widget liberationDynamicListView( ); } -Widget messageHistoryItem( - BuildContext context, dynamic jsonBody) { +Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -250,55 +249,60 @@ Widget messageHistoryItem( Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ) - ], - ), - SizedBox(height: 8), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, + Row( + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: FlutterFlowTheme.of(context).customColor6, + overflow: TextOverflow.ellipsis, + ), ), - overflow: TextOverflow.fade, ), - ), + ], + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + ), + ], ), ], ), SizedBox(height: 8), - Text(jsonBody['MSG_TEXTO'].toString(),), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + SizedBox(height: 8), ], ), ), ), ), ); - - -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index cac62056..d7c05015 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -51,41 +51,8 @@ class PreferencesPageModel with ChangeNotifier { void enablePerson(BuildContext context) { notifyListeners(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(FFAppState().userDevUUID, - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.share, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - // Implement share functionality here - Share.share( - FFAppState().userDevUUID, - ); - }, - ), - ], - ), - backgroundColor: FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 1), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), + Share.share( + FFAppState().userDevUUID, ); } diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 8a036ed9..e0aa39c1 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -113,8 +113,8 @@ class PreferencesPageWidget extends StatelessWidget { onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; content = FFLocalizations.of(context).getVariableText( - ptText: 'Exibir código de identificação remota', - enText: 'Display remote identification code', + ptText: 'Compartilhe o código de identificação remota', + enText: 'Share the remote identification code', ); break; case 2: diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 1551cf20..d1ea6e19 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -1,11 +1,14 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/request_manager.dart'; import 'package:flutter/material.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +import 'package:intl/intl.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { @@ -37,6 +40,18 @@ class ScheduleCompleteVisitPageModel visitorJsonList[index] = updateFn(visitorJsonList[index]); String visitorStrList = '0'; + bool? dropDownValidator1; + bool? dropDownValidator2; + + bool isValid() { + if ((textController1!.text != '') && + (textController2!.text != '') && + (dropDownValue1 != null && dropDownValue1 != '') && + (dropDownValue2 != null && dropDownValue2 != '')) { + return true; + } + return false; + } /// State fields for stateful widgets in this page. @@ -50,16 +65,66 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime endDate = + DateFormat('d/M/y H:mm:ss').parse(textController2!.text); + if (startDate.isAfter(endDate)) { + return FFLocalizations.of(context).getVariableText( + ptText: 'A data de início deve ser anterior à data de término.', + enText: 'Start date must be before end date.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } DateTime? datePicked1; // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime startDate = + DateFormat('d/M/y H:mm:ss').parse(textController1!.text); + if (endDate.isBefore(startDate)) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after start date.', + ptText: 'A data de término deve ser posterior à data de início.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + DateTime? datePicked2; // State field(s) for DropDown widget. String? dropDownValue1; FormFieldController? dropDownValueController1; + // State field(s) for DropDown widget. String? dropDownValue2; FormFieldController? dropDownValueController2; @@ -69,9 +134,35 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + // if (val == null || val.isEmpty) { + // return FFLocalizations.of(context).getVariableText( + // enText: 'This field is required.', + // ptText: 'Este campo é obrigatório.', + // ); + // } + return null; + } @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + tabBarController = TabController( + vsync: Navigator.of(context), + length: 2, + ); + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + } @override void dispose() { diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 07a4c7ca..868ba7a8 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -7,7 +7,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; @@ -264,155 +263,151 @@ Widget scheduleVisit( child: Column( mainAxisSize: MainAxisSize.max, children: [ - Stack( - children: [ - Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - _model.removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.end, children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), IconButton( onPressed: () async { _model @@ -421,1239 +416,440 @@ Widget scheduleVisit( setState(() {}); }, icon: const Icon(Icons.close)), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart( - const SizedBox(width: 30.0)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.9, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), ), ), ); }, - ); + ).then((value) => safeSetState(() {})); }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.9, - width: MediaQuery.of(context) - .size - .width, - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: - MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe' /* Qual o período de validade da ... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + readOnly: true, + focusNode: _model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + '53cbwqh9' /* Quando você inicia a visita? */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent4, - width: 1.0, + width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController1Validator + .asValidator(context)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), + .headlineLargeFamily), ), - ), - ), - ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - '53cbwqh9' /* Quando você inicia a visita? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked1Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - _model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - setState(() { - _model.textController1?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked1, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController1 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController1! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 55.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - 'xpgc5e8d' /* Quando a visita terminá? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked2Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked2Date != null && - datePicked2Time != null) { - safeSetState(() { - _model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - setState(() { - _model.textController2?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked2, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController2 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController2! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 39.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u' /* Quais são os motivos da visita... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of( context) - .bodyMediumFamily), + .headlineLargeFamily), ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr' /* Escolha um motivo aqui */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: + pickerBackgroundColor: FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, ); }, - ), + ); + } + + if (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + _model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + setState(() { + _model.textController1?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController1?.selection = + TextSelection.collapsed( + offset: _model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), ), ), ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .levelJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c' /* Escolha um nível de acesso aqu... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), + ), + ], + ), ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1' /* Visita se encerra após o prime... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht' /* Visita única */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch.adaptive( - value: _model.switchValue!, - onChanged: (newValue) async { - setState(() => _model.switchValue = newValue); - }, - applyCupertinoTheme: false, - focusColor: - FlutterFlowTheme.of(context).primary, - trackColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .alternate; - } - return FlutterFlowTheme.of(context) - .alternate; - }, - ), - hoverColor: FlutterFlowTheme.of(context) - .primaryBackground, - // thumbColor: WidgetStateColor.resolveWith( - // (states) { - // if (states.contains(WidgetState.disabled)) { - // return FlutterFlowTheme.of(context) - // .alternate; - // } - // return FlutterFlowTheme.of(context) - // .alternate; - // }, - // ), - overlayColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - trackOutlineColor: - WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - activeColor: - FlutterFlowTheme.of(context).success, - activeTrackColor: FlutterFlowTheme.of(context) - .primaryBackground, - inactiveTrackColor: FlutterFlowTheme.of(context) - .primaryBackground, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'eftcs67c' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, + 24.0, 0.0, 24.0, 0.0), child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, + readOnly: true, + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: + AutovalidateMode.onUserInteraction, autofocus: false, - textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup' /* Observações da Visita */, - ), labelStyle: FlutterFlowTheme.of(context) .labelMedium .override( @@ -1668,7 +864,7 @@ Widget scheduleVisit( .labelMediumFamily), ), hintText: FFLocalizations.of(context).getText( - 'w18iztdm' /* Escreva as suas observações aq... */, + 'xpgc5e8d' /* Quando a visita terminá? */, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -1682,37 +878,38 @@ Widget scheduleVisit( .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + lineHeight: 1.0, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent4, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).primary, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), suffixIcon: Icon( - Icons.text_fields, + Icons.date_range, color: FlutterFlowTheme.of(context).accent1, ), ), @@ -1721,117 +918,736 @@ Widget scheduleVisit( .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + _model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + setState(() { + _model.textController2?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController2?.selection = + TextSelection.collapsed( + offset: _model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ] + // .divide(const SizedBox(height: 0.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u' /* Quais são os motivos da visita... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final reasonsJsonList = + PhpGroup.getDadosCall.reasonsJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= '', + ), + options: reasonsJsonList != null && + reasonsJsonList != [] + ? List.from( + PhpGroup.getDadosCall + .reasonsJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .reasonsMotDescStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr' /* Escolha um motivo aqui */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final lavelList = + PhpGroup.getDadosCall.levelJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= '', + ), + options: + lavelList != null && lavelList != [] + ? List.from(lavelList! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .levelNACDescricaoStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c' /* Escolha um nível de acesso aqu... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1' /* Visita se encerra após o prime... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht' /* Visita única */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: _model.textController3Validator - .asValidator(context), ), ), ), + Switch.adaptive( + value: _model.switchValue!, + onChanged: (newValue) async { + setState(() => _model.switchValue = newValue); + }, + applyCupertinoTheme: false, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } + return FlutterFlowTheme.of(context).alternate; + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, + ), ], ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], - ), + ), + ], ), - ), - ], - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if ((_model.textController1.text != '') && - (_model.textController2.text != '') && - (_model.dropDownValue1 != null && - _model.dropDownValue1 != '') && - (_model.dropDownValue2 != null && - _model.dropDownValue2 != '')) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: VisitDetailsModalTemplateComponentWidget( - visitStartDateStr: _model.textController1.text, - visitEndDateStr: _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: - _model.switchValue == true ? 'Sim' : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c' /* Você tem alguma observação sob... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: 'Campos obrigatórios imcompletos.', + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm' /* Escreva as suas observações aq... */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: _model.textController3Validator + .asValidator(context), ), ), - ); - }, - ).then((value) => safeSetState(() {})); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width * 0.5, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(10.0), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text(FFLocalizations.of(context).getVariableText( - enText: 'Schedule', - ptText: 'Agendar', - )), - ), + ), + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], ), ), + FFButtonWidget( + text: 'Schedule', + onPressed: _model.isValid() + ? () async { + await showDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.5, + child: VisitDetailsModalTemplateComponentWidget( + visitStartDateStr: _model.textController1.text, + visitEndDateStr: _model.textController2.text, + visitReasonStr: _model.dropDownValue1, + visitLevelStr: _model.dropDownValue2, + visitTempStr: + _model.switchValue == true ? 'Sim' : 'Não', + visitObsStr: _model.textController3.text, + visitorStrList: _model.visitorStrList, + visitorJsonList: _model.visitorJsonList, + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), ].addToEnd(const SizedBox(height: 30.0)), ), ); @@ -2367,10 +2183,10 @@ Widget visitHistory( fadeOutDuration: const Duration(milliseconds: 500), imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), fit: BoxFit.cover, From 57bfbe33d9af2d502706158e15bdfb778a16b63a Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 31 Jul 2024 17:43:51 -0300 Subject: [PATCH 10/72] fix: ScheduleCompleteVisitPageModel => ScheduleCompleteVisit --- .../visitor_not_found_component_widget.dart | 256 ++- .../schedule_visit_detail_model.dart | 36 +- .../schedule_visit_detail_widget.dart | 1504 ++++++++--------- ...iter_vistor_template_component_widget.dart | 10 +- ...tails_modal_template_component_widget.dart | 90 +- ...earch_modal_template_component_widget.dart | 20 +- lib/flutter_flow/upload_data.dart | 54 +- .../schedule_complete_visit_page_model.dart | 12 + .../schedule_complete_visit_page_widget.dart | 600 +++---- 9 files changed, 1245 insertions(+), 1337 deletions(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 783d3801..9ffcdc37 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -41,146 +41,138 @@ class _VisitorNotFoundComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - width: 350.0, - height: 350.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + return Container( + width: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.4, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, + Icon( + Icons.notifications_none, + color: FlutterFlowTheme.of(context).accent1, + size: 72.0, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '1p9mykbj' /* Usuário não encontrado */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: + FlutterFlowTheme.of(context).headlineMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), ), - onPressed: () async { - Navigator.pop(context); - }, - ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'kt937sp6' /* O documento inserido não corre... */, ), - ), - Icon( - Icons.notifications_none, - color: FlutterFlowTheme.of(context).accent1, - size: 72.0, - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1p9mykbj' /* Usuário não encontrado */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kt937sp6' /* O documento inserido não corre... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontStyle: FontStyle.italic, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: FFButtonWidget( - onPressed: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: true, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: SizedBox( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.9, - child: - const RegisiterVistorTemplateComponentWidget( - source: 'VisitorNotFoundComponent', - )), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFLocalizations.of(context).getText( - 'y2x4nfcn' /* Adicionar */, + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontStyle: FontStyle.italic, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + ), + ), + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: FFButtonWidget( + onPressed: () async { + Navigator.pop(context); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: true, + useSafeArea: true, + isDismissible: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), + options: FFButtonOptions( + width: double.infinity, + height: 30.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], - ), + ), + ], ), ); } diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index 39705ca6..d4df4084 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,9 +1,11 @@ -import 'package:hub/backend/api_requests/api_manager.dart'; +import 'dart:developer'; +import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:intl/intl.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -36,6 +38,36 @@ class ScheduleVisitDetailModel // Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget. ApiCallResponse? postScheduleVisit; + String convertDateFormat(String dateStr) { + try { + log('Received date string: $dateStr'); + + // Formato original + DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + // Novo formato + DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); + + // Validate the input string format + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { + log('Invalid date format: $dateStr'); + return 'Invalid date format'; + } + + // Converte a string para DateTime + DateTime dateTime = originalFormat.parse(dateStr); + + // Converte DateTime para a nova string formatada + String formattedDate = newFormat.format(dateTime); + log('Formatted date: $formattedDate'); + return formattedDate; + } catch (e) { + // Handle the exception by returning an error message or a default value + log('Error parsing date: $e'); + return 'Invalid date format'; + } + } + @override void initState(BuildContext context) {} @@ -59,4 +91,4 @@ class ScheduleVisitDetailModel textFieldFocusNode6?.dispose(); textController6?.dispose(); } -} \ No newline at end of file +} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index ad430d41..150dd715 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -13,6 +13,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_model.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:provider/provider.dart'; class ScheduleVisitDetailWidget extends StatefulWidget { @@ -46,6 +47,7 @@ class ScheduleVisitDetailWidget extends StatefulWidget { class _ScheduleVisitDetailWidgetState extends State { late ScheduleVisitDetailModel _model; + late FocusNode _focusNode; @override void setState(VoidCallback callback) { @@ -56,6 +58,7 @@ class _ScheduleVisitDetailWidgetState extends State { @override void initState() { super.initState(); + _focusNode = FocusNode(); _model = createModel(context, () => ScheduleVisitDetailModel()); _model.textController1 ??= TextEditingController(text: widget.visitTempStr); @@ -83,39 +86,51 @@ class _ScheduleVisitDetailWidgetState extends State { @override void dispose() { _model.maybeDispose(); + _focusNode.dispose(); super.dispose(); } + void _requestFocus() { + if (mounted) { + _focusNode.requestFocus(); + } + } + @override Widget build(BuildContext context) { context.watch(); + final visitorsData = widget.visitorJsonList!.toList().take(2).toList(); + final visitorsDataItem = visitorsData[0]; return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + child: GestureDetector( + onTap: () { + _requestFocus(); + }, + child: Container( + // color: FlutterFlowTheme.of(context).primaryBackground, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.6, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( width: double.infinity, height: 35.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(0.0), bottomRight: Radius.circular(0.0), @@ -137,7 +152,7 @@ class _ScheduleVisitDetailWidgetState extends State { buttonSize: 40.0, icon: Icon( Icons.keyboard_return, - color: FlutterFlowTheme.of(context).primaryBackground, + color: FlutterFlowTheme.of(context).accent1, size: 24.0, ), onPressed: () async { @@ -148,842 +163,681 @@ class _ScheduleVisitDetailWidgetState extends State { ), ), ), - ), - Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 20.0), + child: SizedBox( + width: 100.0, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorsDataItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), + ), + ), + ), Column( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), + Container( + decoration: const BoxDecoration(), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 5.0, 0.0, 5.0, 20.0), - child: Container( - width: 100.0, - decoration: const BoxDecoration(), - child: Builder( - builder: (context) { - final visitorsData = widget.visitorJsonList! - .toList() - .take(1) - .toList(); - - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(visitorsData.length, - (visitorsDataIndex) { - final visitorsDataItem = - visitorsData[visitorsDataIndex]; - return Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(100.0), - ), - child: Align( - alignment: const AlignmentDirectional( - 1.0, -1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - // Navigator.pop(context); - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: - // Colors.transparent, - // useSafeArea: true, - // context: context, - // builder: (context) { - // return Padding( - // padding: - // MediaQuery.viewInsetsOf( - // context), - // child: - // VisitorDetailsModalTemplateComponentWidget( - // visitorImageURL: '', - // visitorEmail: '', - // visitorName: '', - // visitorPhone: '', - // visitorType: '', - // ), - // ); - // }, - // ).then((value) => - // safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: - valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorsDataItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 100.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ), - ), - ); - }), + 8.0, 0.0, 8.0, 10.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '7w4fohoa' /* Encerramento da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - ); - }, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController1Validator + .asValidator(context), ), ), ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 10.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context).getText( - '7w4fohoa' /* Encerramento da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context) + .getVariableText( + enText: 'Start', + ptText: 'Início', ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '0cp1e31d' /* dd/mm/yyyy */, ), - validator: _model.textController1Validator - .asValidator(context), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'snah4iet' /* Início */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '0cp1e31d' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController2Validator - .asValidator(context), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'abppdgz3' /* Término */, ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'abppdgz3' /* Término */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'kqralft4' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'xjxhzqqm' /* Motivo da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '47oezdm6' /* Motivo */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - '2ujg7u18' /* Nível de Acesso */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '3emmbbfv' /* Nível de Acesso */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController5Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController6, - focusNode: _model.textFieldFocusNode6, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'ritce5uw' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + 'kqralft4' /* dd/mm/yyyy */, ), - validator: _model.textController6Validator - .asValidator(context), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), ), ), - ), - ], + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'xjxhzqqm' /* Motivo da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '47oezdm6' /* Motivo */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + '2ujg7u18' /* Nível de Acesso */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '3emmbbfv' /* Nível de Acesso */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController5Validator + .asValidator(context), + ), + ), + ), + ], + ), ), Container( - width: double.infinity, - height: 22.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController6, + focusNode: _model.textFieldFocusNode6, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'ritce5uw' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController6Validator + .asValidator(context), ), ), ), - ] - .divide(const SizedBox(height: 30.0)) - .addToStart(const SizedBox(height: 100.0)), + ], ), - ], + ].divide(const SizedBox(height: 0.0)), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.postScheduleVisit = - await PhpGroup.postScheduleVisitCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - atividade: 'putVisita', - devDesc: widget.visitObsStr, - idVisitante: widget.visitorStrList, - dtInicio: widget.visitStartDate, - dtFim: widget.visitEndDate, - unica: widget.visitTempStr, - idMotivo: extractIdToStr(widget.visitResonStr!), - idNAC: extractIdToStr(widget.visitLevelStr!), - obs: widget.visitObsStr, - cliID: FFAppState().cliUUID, - ); + IconButton( + onPressed: () async { + _model.postScheduleVisit = + await PhpGroup.postScheduleVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + atividade: 'putVisita', + devDesc: widget.visitObsStr, + idVisitante: widget.visitorStrList, + dtInicio: + _model.convertDateFormat(widget.visitStartDate ?? ''), + dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''), + unica: widget.visitTempStr, + idMotivo: extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), + obs: widget.visitObsStr, + cliID: FFAppState().cliUUID, + ); - if (PhpGroup.postScheduleVisitCall.error( - (_model.postScheduleVisit?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitCall.errorMsg( - (_model.postScheduleVisit?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } + if (PhpGroup.postScheduleVisitCall.error( + (_model.postScheduleVisit?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitCall.errorMsg( + (_model.postScheduleVisit?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } - setState(() {}); - }, - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).secondaryText, - size: 24.0, - ), - ), + setState(() {}); + }, + icon: Icon( + Icons.check, + color: FlutterFlowTheme.of(context).primary, + size: 15.0, ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index b47c79ee..9e187e31 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -485,9 +485,9 @@ class _RegisiterVistorTemplateComponentWidgetState final selectedMedia = await selectMediaWithSourceBottomSheet( context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, + // maxWidth: 300.00, + // maxHeight: 300.00, + imageQuality: 100, allowPhoto: true, includeDimensions: true, ); @@ -567,7 +567,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent1, - width: 0.5, + width: 0.2, ), borderRadius: BorderRadius.circular(8.0), ), @@ -915,7 +915,7 @@ class _RegisiterVistorTemplateComponentWidgetState options: FFButtonOptions( width: 250.0, height: 36.0, - disabledColor: FlutterFlowTheme.of(context).customColor6, + disabledColor: FlutterFlowTheme.of(context).customColor5, padding: const EdgeInsetsDirectional.fromSTEB( 80.0, 0.0, 80.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 8a9309f9..a5e922e8 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,6 +1,3 @@ - - - import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; @@ -74,50 +71,47 @@ class _VisitDetailsModalTemplateComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Builder( - builder: (context) { - if (widget.visitStatusStr != null && widget.visitStatusStr != '') { - return wrapWithModel( - model: _model.viewVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ViewVisitDetailWidget( - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitReasonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitStatusStr: widget.visitStatusStr!, - visitorStrList: widget.visitorStrList!, - visitorJsonList: widget.visitorJsonList, - visitIdStr: widget.visitIdStr!, - visitStatusColor: widget.visitStatusColor!, - ), - ); - } else { - return wrapWithModel( - model: _model.scheduleVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ScheduleVisitDetailWidget( - visitorStrList: widget.visitorStrList!, - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitResonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitorJsonList: widget.visitorJsonList!, - ), - ); - } - }, - ), + return Builder( + builder: (context) { + if (widget.visitStatusStr != null && widget.visitStatusStr != '') { + return wrapWithModel( + model: _model.viewVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ViewVisitDetailWidget( + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitReasonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitStatusStr: widget.visitStatusStr!, + visitorStrList: widget.visitorStrList!, + visitorJsonList: widget.visitorJsonList, + visitIdStr: widget.visitIdStr!, + visitStatusColor: widget.visitStatusColor!, + ), + ); + } else { + return wrapWithModel( + model: _model.scheduleVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ScheduleVisitDetailWidget( + visitorStrList: widget.visitorStrList!, + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitResonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitorJsonList: widget.visitorJsonList!, + ), + ); + } + }, ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 35b21ac6..963676a9 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -109,16 +109,20 @@ class _VisitorSearchModalTemplateComponentWidgetState _model.addToDocs(_model.textController.text); setState(() {}); } else { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: true, - isDismissible: true, - backgroundColor: Colors.transparent, + await showAdaptiveDialog( + useSafeArea: true, context: context, builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), + return Dialog( + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Container( + color: Colors.transparent, + // width: MediaQuery.of(context).size.height * 0.1, + // height: + // MediaQuery.of(context).size.height * 0.4, + child: const VisitorNotFoundComponentWidget()), + ), ); }, ).then((value) => safeSetState(() {})); diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 917034cd..c7c4c597 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -58,23 +58,23 @@ Future?> selectMediaWithSourceBottomSheet({ bool includeBlurHash = false, }) async { createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontWeight: FontWeight.w600, - fontSize: 20, - ), - ), - tileColor: FlutterFlowTheme.of(context).primaryBackground, - dense: false, - onTap: () => Navigator.pop( - context, - mediaSource, - ), - ); + title: Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 20, + ), + ), + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: false, + onTap: () => Navigator.pop( + context, + mediaSource, + ), + ); final mediaSource = await showModalBottomSheet( context: context, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -91,7 +91,9 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), @@ -360,18 +362,26 @@ void showUploadMessage( child: CircularProgressIndicator( valueColor: Theme.of(context).brightness == Brightness.dark ? AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).accent4) + FlutterFlowTheme.of(context).info) : null, ), ), - Text(message), + Text(message, style: FlutterFlowTheme.of(context).bodyMedium), ], ), - duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4), + backgroundColor: FlutterFlowTheme.of(context).primary, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + duration: + showLoading ? const Duration(days: 1) : const Duration(seconds: 4), ), ); } String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/') ? path.substring(0, path.length - 1) - : path; \ No newline at end of file + : path; diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index d1ea6e19..23a7f0d0 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -83,6 +83,12 @@ class ScheduleCompleteVisitPageModel enText: 'Start date must be before end date.', ); } + if (startDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'Start date must be after current date.', + ptText: 'A data de início deve ser posterior à data atual.', + ); + } } catch (e) { return '$e'; } @@ -113,6 +119,12 @@ class ScheduleCompleteVisitPageModel ptText: 'A data de término deve ser posterior à data de início.', ); } + if (endDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after current date.', + ptText: 'A data de término deve ser posterior à data atual.', + ); + } } catch (e) { return '$e'; } diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 868ba7a8..20874759 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -269,300 +269,12 @@ Widget scheduleVisit( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - // context: context, - // builder: (context) { - // return GestureDetector( - // onTap: () => _model - // .unfocusNode.canRequestFocus - // ? FocusScope.of(context) - // .requestFocus(_model.unfocusNode) - // : FocusScope.of(context).unfocus(), - // child: Padding( - // padding: - // MediaQuery.viewInsetsOf(context), - // child: - // const VisitorDetailsModalTemplateComponentWidget( - // visitorImageURL: '', - // visitorEmail: '', - // visitorName: '', - // visitorPhone: '', - // visitorType: '', - // ), - // ), - // ); - // }, - // ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - // _model.removeFromVisitorJsonList( - // visitorListViewItem); - // setState(() {}); - }, - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - fit: BoxFit.cover, - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - IconButton( - onPressed: () async { - _model - .removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - icon: const Icon(Icons.close)), - ], - ), - ), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ); - }, - ); - }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.9, - width: MediaQuery.of(context).size.width, - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ], - ), - ], - ), Column(mainAxisSize: MainAxisSize.max, children: [ Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), + 20.0, 30.0, 0.0, 24.0), child: Text( FFLocalizations.of(context).getText( '98evnbbe' /* Qual o período de validade da ... */, @@ -1079,6 +791,294 @@ Widget scheduleVisit( ] // .divide(const SizedBox(height: 0.0)), ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -1146,6 +1146,8 @@ Widget scheduleVisit( dropDownGetDadosResponse.jsonBody, ); return FlutterFlowDropDown( + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, controller: _model.dropDownValueController1 ??= FormFieldController( @@ -1326,6 +1328,8 @@ Widget scheduleVisit( const EdgeInsetsDirectional.fromSTEB( 16.0, 0.0, 16.0, 0.0), hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, isOverButton: true, isSearchable: false, isMultiSelect: false, @@ -1602,13 +1606,13 @@ Widget scheduleVisit( ), ), FFButtonWidget( - text: 'Schedule', + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), onPressed: _model.isValid() ? () async { await showDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, context: context, builder: (context) { return GestureDetector( @@ -1619,8 +1623,8 @@ Widget scheduleVisit( child: Dialog( alignment: Alignment.topCenter, child: SizedBox( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.5, + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height * 0.7, child: VisitDetailsModalTemplateComponentWidget( visitStartDateStr: _model.textController1.text, visitEndDateStr: _model.textController2.text, @@ -1645,6 +1649,12 @@ Widget scheduleVisit( height: MediaQuery.of(context).size.height * 0.05, width: MediaQuery.of(context).size.height * 0.2, color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), disabledColor: FlutterFlowTheme.of(context).customColor5), showLoadingIndicator: true, ), From 3b6170bc09d82b99ecdb4d479fbe9fd9797952b9 Mon Sep 17 00:00:00 2001 From: Flavio Escobar Date: Fri, 2 Aug 2024 10:24:39 -0300 Subject: [PATCH 11/72] fix: image upload --- ios/Runner.xcodeproj/project.pbxproj | 4 ++-- ios/Runner/Base.lproj/Main.storyboard | 13 ++++++++----- .../regisiter_vistor_template_component_widget.dart | 9 +++++---- lib/flutter_flow/upload_data.dart | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 93d93c55..4a0cc75e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -41,6 +41,8 @@ 4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; 4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -51,8 +53,6 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C1B4A503715BC7B0F8826983 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index f3c28516..0fb20ec6 100644 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,13 +16,14 @@ - + - + + diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 9e187e31..2632a536 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -491,10 +491,11 @@ class _RegisiterVistorTemplateComponentWidgetState allowPhoto: true, includeDimensions: true, ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { + if (selectedMedia != null){ + // && + // selectedMedia.every((m) => + // validateFileFormat( + // m.storagePath, context))) { setState(() => _model.isDataUploading = true); var selectedUploadedFiles = []; diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index c7c4c597..d0d24a0c 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -11,7 +11,7 @@ import 'package:video_player/video_player.dart'; import 'flutter_flow_theme.dart'; import 'flutter_flow_util.dart'; -const allowedFormats = {'image/png', 'image/jpeg', 'video/mp4', 'image/gif'}; +const allowedFormats = {'image/png', 'image/jpeg'}; class SelectedFile { const SelectedFile({ From 518e4140c4b37712d4ec86245561d69d4c9f9426 Mon Sep 17 00:00:00 2001 From: Flavio Escobar Date: Fri, 2 Aug 2024 10:43:48 -0300 Subject: [PATCH 12/72] WIP --- ...iter_vistor_template_component_widget.dart | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 2632a536..1ab51600 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -335,7 +335,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0), child: Container( width: MediaQuery.sizeOf(context).width * 0.95, decoration: const BoxDecoration(), @@ -345,26 +345,7 @@ class _RegisiterVistorTemplateComponentWidgetState mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), + Padding( padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 5.0), From 5a7bb289f0d9e99dc08868499ab275f6c5d9f1dd Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 10:47:46 -0300 Subject: [PATCH 13/72] WIP --- lib/backend/api_requests/api_calls.dart | 125 ++- .../pushNotificationService.dart | 63 +- .../throw_exception_widget.dart | 1 - .../card_item_template_component_widget.dart | 202 ++-- .../view_visit_detail_widget.dart | 335 ++++--- ...tails_modal_template_component_widget.dart | 19 + ...sit_request_template_component_widget.dart | 897 ++++-------------- lib/main.dart | 3 +- .../liberation_history_widget.dart | 86 +- .../message_history_page_widget.dart | 84 +- .../preferences_settings_model.dart | 446 ++++++--- .../schedule_complete_visit_page_widget.dart | 761 +++++---------- 12 files changed, 1259 insertions(+), 1763 deletions(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 2a8838ec..b198f4d3 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -11,7 +11,6 @@ export 'api_manager.dart' show ApiCallResponse; const _kPrivateApiFunctionName = 'ffPrivateApiCall'; - /// Start PHP Group Code class PhpGroup { @@ -46,6 +45,81 @@ class PhpGroup { static ChangeNotifica changeNotifica = ChangeNotifica(); static RespondeVinculo resopndeVinculo = RespondeVinculo(); static ChangePass changePass = ChangePass(); + static ChangePanic changePanic = ChangePanic(); + static DeleteAccount deleteAccount = DeleteAccount(); +} + +class DeleteAccount { + Future call({ + String? devUUID = '', + String? userUUID = '', + }) async { + final baseUrl = PhpGroup.getBaseUrl(); + return ApiManager.instance.makeApiCall( + callName: 'deleteAccount', + apiUrl: '$baseUrl/deleteAccount.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + } + + bool? error(dynamic response) => castToType(getJsonField( + response, + r'''$.error''', + )); +} + +class ChangePanic { + Future call({ + String? devUUID = '', + String? userUUID = '', + String? cliID = '', + String? atividade = '', + String? newSenhaPanico = '', + }) async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'changePass', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + 'newSenhaPanico': newSenhaPanico, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + } + + bool? error(dynamic response) => castToType(getJsonField( + response, + r'''$.error''', + )); } class ChangePass { @@ -95,31 +169,30 @@ class RespondeVinculo { String? cliID = '', String? tarefa = '', }) async { - final baseUrl = PhpGroup.getBaseUrl(); + final baseUrl = PhpGroup.getBaseUrl(); - return ApiManager.instance.makeApiCall( - callName: 'respondeVinculo', - apiUrl: '$baseUrl/processRequest.php', - callType: ApiCallType.POST, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - params: { - 'devUUID': devUUID, - 'userUUID': userUUID, - 'cliID': cliID, - 'tarefa': tarefa, - }, - bodyType: BodyType.X_WWW_FORM_URL_ENCODED, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, - ); + return ApiManager.instance.makeApiCall( + callName: 'respondeVinculo', + apiUrl: '$baseUrl/responderVinculo.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'tarefa': tarefa, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); } - } class ChangeNotifica { @@ -160,7 +233,7 @@ class ChangeNotifica { response, r'''$.error''', )); -} +} class UpdToken { Future call({ @@ -2433,4 +2506,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { } return isList ? '[]' : '{}'; } -} \ No newline at end of file +} diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 883a9338..df5bfab7 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -4,8 +4,6 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; - - import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -17,11 +15,12 @@ import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:rxdart/rxdart.dart'; // - class PushNotificationService { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = @@ -104,8 +103,6 @@ class PushNotificationService { } } - - void _initializeLocalNotifications( BehaviorSubject context) async { while (context.valueOrNull == null) { @@ -132,9 +129,10 @@ class PushNotificationService { Map message = validJsonFromString(response.payload!); log('Notification payload: $message'); - var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage - log('Extra: ${data.value}'); - _handleNotificationClick(message, extra: data.value); + var data = + _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage + log('Extra: ${data.value}'); + _handleNotificationClick(message, extra: data.value); } catch (e) { log('Error decoding notification payload: $e'); } @@ -191,7 +189,8 @@ class PushNotificationService { _onMessage.add(message); log('Extra: ${message.notification?.body}'); - NotificationHandler().handleMessage(message.data, context); }); + NotificationHandler().handleMessage(message.data, context); + }); } void configureTokenRefresh() { @@ -292,14 +291,16 @@ class PushNotificationService { ); } - _handleNotificationClick(Map payload, {Map extra = const {}}) { + _handleNotificationClick(Map payload, + {Map extra = const {}}) { switch (payload.isNotEmpty) { case true: // Print the 'data' property log('Notification payload: $payload'); log('Extra: $extra'); // Handle the message data as needed - NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra); + NotificationHandler().handleMessage(payload, _context.value, + extra: extra.isEmpty ? {} : extra); // Access the 'data' property of 'RemoteMessage' case false: log('Notification payload is empty'); @@ -315,7 +316,8 @@ class PushNotificationService { } class NotificationHandler { - void handleMessage(Map message, BuildContext context, {Map extra = const {}}) { + void handleMessage(Map message, BuildContext context, + {Map extra = const {}}) { log('Notification Received!'); message.forEach((key, value) { log('$key: $value'); @@ -331,8 +333,8 @@ class NotificationHandler { case 'access': _showAcessNotificationModal(message, context); break; - case 'mensagem': - _showMessageNotificationDialog(message, context, extra); + case 'mensagem': + _showMessageNotificationDialog(message, context, extra); break; case 'enroll_cond': log('enroll_cond'); @@ -385,8 +387,8 @@ class NotificationHandler { ); } - void _showMessageNotificationDialog( - Map message, BuildContext context, Map extra) { + void _showMessageNotificationDialog(Map message, + BuildContext context, Map extra) { log('Showing message notification dialog'); log('Notification "message": $message'); showDialog( @@ -398,15 +400,18 @@ class NotificationHandler { child: MessageNotificationModalTemplateComponentWidget( id: message['local']['CLI_ID'].toString(), from: message['remetente'].toString(), - to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', - message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), + to: message['destinatario'].toString() == 'O' + ? 'Morador' + : 'Visitante', + message: extra['body'].toString().isEmpty + ? 'Unknown' + : extra['body'].toString(), ), ); }, ); } - void _showVisitRequestDialog( Map message, BuildContext context) { log('Showing visit request notification dialog'); @@ -424,6 +429,22 @@ class NotificationHandler { vteUUID: message['idVisitante'].toString(), vawRef: message['referencia'].toString(), vawStatus: 'S', + labelsHashMap: Map.from({ + 'key': message['documento'], + 'value': 'E', + }), + imageHashMap: Map.from({ + 'key': message['documento'], + 'value': 'E', + }), + statusHashMap: [ + { + FFLocalizations.of(context).getVariableText( + enText: 'Pending', + ptText: 'Pendente', + ): FlutterFlowTheme.of(context).primary, + }, + ], changeStatusAction: changeStatusAction, ), ); @@ -448,6 +469,4 @@ class PushNotificationManager { void dispose() { _onMessageReceivedController.close(); } - - -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index 9f037c96..27187afb 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -93,7 +93,6 @@ class _ThrowExceptionWidgetState extends State case EnumThrowException.success: return FFLocalizations.of(context) .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); - ; } } diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index a1e4cfc6..fd8b4c48 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -12,8 +12,6 @@ export 'card_item_template_component_model.dart'; /// - - class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ super.key, @@ -25,7 +23,7 @@ class CardItemTemplateComponentWidget extends StatefulWidget { final Map? labelsHashMap; final List?> statusHashMap; - final Map imageHashMap; + final Map imageHashMap; final Future Function()? onTapCardItemAction; @override @@ -40,7 +38,9 @@ class _CardItemTemplateComponentWidgetState LinkedHashMap.from(widget.labelsHashMap ?? {}); List> get statusLinkedHashMap => - widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); + widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); @override void setState(VoidCallback callback) { @@ -74,9 +74,14 @@ class _CardItemTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - - - + log('------------------------------'); + log('labelsHashMap: ${widget.labelsHashMap}'); + log('statusHashMap: ${widget.statusHashMap}'); + log('imageHashMap: ${widget.imageHashMap}'); + log('onTapCardItemAction: ${widget.onTapCardItemAction}'); + log('labelsLinkedHashMap: $labelsLinkedHashMap'); + log('statusLinkedHashMap: $statusLinkedHashMap'); + log('------------------------------'); return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -89,7 +94,7 @@ class _CardItemTemplateComponentWidgetState padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), child: Card( clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context).secondaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), @@ -98,7 +103,7 @@ class _CardItemTemplateComponentWidgetState width: 350.0, height: 115.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).secondaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -106,27 +111,27 @@ class _CardItemTemplateComponentWidgetState children: [ Expanded( child: Container( - width: 100.0, - height: 100.0, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: labelsLinkedHashMap.length, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - String key = - labelsLinkedHashMap.keys.elementAt(index); - String value = labelsLinkedHashMap[key]!; - return Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: Padding( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: labelsLinkedHashMap.length, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String key = + labelsLinkedHashMap.keys.elementAt(index); + String value = labelsLinkedHashMap[key]!; + return Padding( padding: - const EdgeInsets.fromLTRB(20, 0, 0, 0), + const EdgeInsets.fromLTRB(20, 0, 0, 5), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: @@ -157,68 +162,80 @@ class _CardItemTemplateComponentWidgetState const SizedBox( width: 5.0), // Espaçamento entre o label e o valor - Text( - value, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), + Flexible( + child: Text( + value, + overflow: TextOverflow.ellipsis, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), ), ], ), - ), - ); - }, + ); + }, + ), ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries.map((MapEntry item) { - return Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), - child: Container( - width: 100.0, - height: 27.0, - decoration: BoxDecoration( - color: item.value, // Usa a cor do item atual - borderRadius: BorderRadius.circular(5.0), - ), - child: Align( - alignment: Alignment.center, - child: Text( - item.key, // Usa a chave do item atual como texto - style: TextStyle( - color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: + statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 1.0, vertical: 3.0), + child: Container( + width: 100.0, + height: 27.0, + decoration: BoxDecoration( + color: item + .value, // Usa a cor do item atual + borderRadius: + BorderRadius.circular(5.0), + ), + child: Align( + alignment: Alignment.center, + child: Text( + item.key, // Usa a chave do item atual como texto + style: TextStyle( + color: FlutterFlowTheme.of( + context) + .info, // Ajuste conforme necessário + ), ), ), ), ), - ), - ], - ), - ); - }).toList(); - }).toList(), - ), - ]), + ], + ), + ); + }).toList(); + }).toList(), + ), + ]), + ), ), ), Padding( @@ -226,18 +243,19 @@ class _CardItemTemplateComponentWidgetState 10.0, 10.0, 10.0, 10.0), child: ClipRRect( borderRadius: BorderRadius.circular(22.0), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - // 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + child: AspectRatio( + aspectRatio: + 1.0, // Define a proporção desejada (1:1 neste caso) + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + fit: BoxFit.cover, ), - fit: BoxFit.cover, ), ), - ), + ) ], ), ), @@ -245,4 +263,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index 0b82c87a..949290cb 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -131,10 +131,10 @@ class _ViewVisitDetailWidgetState extends State { context.watch(); return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0), child: Container( - width: double.infinity, - height: double.infinity, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -264,6 +264,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode1, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( '9yu35pzg' /* Encerramento da Visita */, @@ -348,6 +352,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode2, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( 'aj6scczp' /* Início */, @@ -436,6 +444,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode3, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( 'rvi5z7wg' /* Término */, @@ -534,6 +546,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode4, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( 'yxilg7ek' /* Motivo da Visita */, @@ -622,6 +638,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode5, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( 'dgr3pk3a' /* Nível de Acesso */, @@ -714,6 +734,10 @@ class _ViewVisitDetailWidgetState extends State { focusNode: _model.textFieldFocusNode6, autofocus: false, obscureText: false, + showCursor: false, + enabled: false, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( 'lppn9rxa' /* Observações da Visita */, @@ -785,178 +809,153 @@ class _ViewVisitDetailWidgetState extends State { ], ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: widget.visitStatusColor, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: Builder( - builder: (context) { - if (widget.visitStatusStr == 'A') { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.block_sharp, - color: FlutterFlowTheme.of(context) - .primaryBackground, - size: 24.0, - ), - onPressed: () async { - _model.deleteVisit = - await PhpGroup.deleteVisitCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'cancelaVisita', - idVisita: widget.visitIdStr, - ); + Builder( + builder: (context) { + if (widget.visitStatusStr == 'A') { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + // fillColor: widget.visitStatusColor, + icon: Icon( + Icons.block_sharp, + color: FlutterFlowTheme.of(context).error, + size: 24.0, + ), + onPressed: () async { + _model.deleteVisit = + await PhpGroup.deleteVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'cancelaVisita', + idVisita: widget.visitIdStr, + ); - if (PhpGroup.deleteVisitCall.error( - (_model.deleteVisit?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.deleteVisitCall.msg( - (_model.deleteVisit?.jsonBody ?? - ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - ), - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.share, - color: FlutterFlowTheme.of(context) - .primaryBackground, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - // Implement share functionality here - Share.share( - 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', - ); - }, - ), - ], - ); - } else if ((widget.visitStatusStr == 'C') || - (widget.visitStatusStr == 'F') || - (widget.visitStatusStr == 'B') || - (widget.visitStatusStr == 'I')) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { + if (PhpGroup.deleteVisitCall.error( + (_model.deleteVisit?.jsonBody ?? ''), + ) == + false) { Navigator.pop(context); - - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'visitStartDateStr': serializeParam( - dateTimeFormat( - 'd/M/y H:mm:ss', - getCurrentTimestamp, - locale: FFLocalizations.of(context) - .languageCode, + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.deleteVisitCall.msg( + (_model.deleteVisit?.jsonBody ?? ''), + )!, ), - ParamType.String, - ), - 'visitEndDateStr': serializeParam( - '', - ParamType.String, - ), - 'visitReasonStr': serializeParam( - widget.visitReasonStr, - ParamType.String, - ), - 'visitLevelStr': serializeParam( - widget.visitLevelStr, - ParamType.String, - ), - 'visitTempBol': serializeParam( - widget.visitTempStr == 'Sim' ? true : false, - ParamType.bool, - ), - 'visitObsStr': serializeParam( - widget.visitObsStr, - ParamType.String, - ), - 'visitorStrList': serializeParam( - widget.visitorStrList, - ParamType.String, - ), - 'visitorJsonList': serializeParam( - filteredVisitorJsonList, - ParamType.JSON, - isList: true, - ), - }.withoutNulls, - ); - }, - child: Icon( - Icons.repeat, - color: FlutterFlowTheme.of(context).secondaryText, - size: 24.0, + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + ), + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.share, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + // Implement share functionality here + Share.share( + 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', + ); + }, + ), + ], + ); + } else if ((widget.visitStatusStr == 'C') || + (widget.visitStatusStr == 'F') || + (widget.visitStatusStr == 'B') || + (widget.visitStatusStr == 'I')) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + + context.pushNamed( + 'scheduleCompleteVisitPage', + queryParameters: { + 'visitStartDateStr': serializeParam( + dateTimeFormat( + 'd/M/y H:mm:ss', + getCurrentTimestamp, + locale: FFLocalizations.of(context).languageCode, + ), + ParamType.String, ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, + 'visitEndDateStr': serializeParam( + '', + ParamType.String, ), - ); - } + 'visitReasonStr': serializeParam( + widget.visitReasonStr, + ParamType.String, + ), + 'visitLevelStr': serializeParam( + widget.visitLevelStr, + ParamType.String, + ), + 'visitTempBol': serializeParam( + widget.visitTempStr == 'Sim' ? true : false, + ParamType.bool, + ), + 'visitObsStr': serializeParam( + widget.visitObsStr, + ParamType.String, + ), + 'visitorStrList': serializeParam( + widget.visitorStrList, + ParamType.String, + ), + 'visitorJsonList': serializeParam( + filteredVisitorJsonList, + ParamType.JSON, + isList: true, + ), + }.withoutNulls, + ); }, - ), - ), - ), + child: Icon( + Icons.repeat, + color: widget.visitStatusColor, + size: 24.0, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + ); + } + }, ), - ], + ].addToEnd(const SizedBox(height: 5.0)), ), ), ); diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index a5e922e8..2020de23 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; @@ -71,6 +73,23 @@ class _VisitDetailsModalTemplateComponentWidgetState @override Widget build(BuildContext context) { + log('------------------ VisitDetailsModalTemplateComponentWidget ------------------'); + log('visitStatusStr: ${widget.visitStatusStr}'); + log('visitStartDateStr: ${widget.visitStartDateStr}'); + log('visitEndDateStr: ${widget.visitEndDateStr}'); + log('visitReasonStr: ${widget.visitReasonStr}'); + log('visitLevelStr: ${widget.visitLevelStr}'); + log('visitTempStr: ${widget.visitTempStr}'); + log('visitObsStr: ${widget.visitObsStr}'); + log('visitorStrList: ${widget.visitorStrList}'); + log('visitorJsonList: ${widget.visitorJsonList}'); + log('visitorImgPath: ${widget.visitorImgPath}'); + log('visitorImgList: ${widget.visitorImgList}'); + log('visitIdStr: ${widget.visitIdStr}'); + log('updateToggleIdx: ${widget.updateToggleIdx}'); + log('repeatVisitSchedule: ${widget.repeatVisitSchedule}'); + log('visitStatusColor: ${widget.visitStatusColor}'); + log('-----------------------------------------------------------------------------'); return Builder( builder: (context) { if (widget.visitStatusStr != null && widget.visitStatusStr != '') { diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index faae71ee..8211b6e9 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -1,3 +1,6 @@ +import 'dart:collection'; +import 'dart:developer'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -8,11 +11,9 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:provider/provider.dart'; - - class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ - super.key, + Key? key, required this.vteName, required this.vteReason, required this.vteMsg, @@ -27,8 +28,17 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget { required this.vawStatus, this.vawDate, this.changeStatusAction, + required this.labelsHashMap, + required this.statusHashMap, + required this.imageHashMap, + this.onTapCardItemAction, }); + final Map labelsHashMap; + final List?> statusHashMap; + final Map imageHashMap; + final Future Function()? onTapCardItemAction; + final String? vteName; final String? vteReason; final String? vteMsg; @@ -60,6 +70,14 @@ class _VisitRequestTemplateComponentWidgetState extends State { late VisitRequestTemplateComponentModel _model; + LinkedHashMap get labelsLinkedHashMap => + LinkedHashMap.from(widget.labelsHashMap ?? {}); + + List> get statusLinkedHashMap => + widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); + @override void setState(VoidCallback callback) { super.setState(callback); @@ -102,738 +120,163 @@ class _VisitRequestTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); bool isLoaded = false; + log('------------------ VisitRequestTemplateComponentWidget ------------------'); + log('vteName: ${widget.imageHashMap}'); + log('Teste: ${statusLinkedHashMap.expand((linkedHashMap) { + return [ + linkedHashMap.entries + .map((MapEntry item) => item.key) + .first + ]; + }).first}'); + log('-------------------------------------------------------------------------'); + final pending = FFLocalizations.of(context).getVariableText( + enText: 'Pending', + ptText: 'Pendente', + ); + final active = FFLocalizations.of(context).getVariableText( + enText: 'Ativo', + ptText: 'Ativo', + ); + final canceled = FFLocalizations.of(context).getVariableText( + enText: 'Canceled', + ptText: 'Cancelado', + ); - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.9, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, + return LayoutBuilder( + builder: (context, constraints) { + return Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Container( + width: constraints.maxWidth, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 150.0, - height: 150.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: valueOrDefault( - // 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.vteDocument}&tipo=E', - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.vteDocument != null ? widget.vteDocument : widget.vteUUID}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - // Container( - // width: 153.0, - // height: 25.0, - // decoration: BoxDecoration( - // color: () { - // if (widget.vawStatus == 'L') { - // return FlutterFlowTheme.of(context).primary; - // } else if (widget.vawStatus == 'B') { - // return FlutterFlowTheme.of(context).error; - // } else if (widget.vawStatus == 'S') { - // return FlutterFlowTheme.of(context).warning; - // } else { - // return FlutterFlowTheme.of(context).warning; - // } - // }(), - // borderRadius: BorderRadius.circular(16.0), - // ), - // child: Align( - // alignment: const AlignmentDirectional(0.0, 0.0), - // child: Text( - // () { - // if (widget.vawStatus == 'L') { - // return FFLocalizations.of(context) - // .getVariableText( - // ptText: 'Ativo', - // enText: 'Active', - // ); - // } else if (widget.vawStatus == 'B') { - // return FFLocalizations.of(context) - // .getVariableText( - // ptText: 'Bloqueado', - // enText: 'Blocked', - // ); - // } else { - // return FFLocalizations.of(context) - // .getVariableText( - // ptText: 'Pendente', - // enText: 'Pending', - // ); - // } - // }(), - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: FlutterFlowTheme.of(context) - // .bodyMediumFamily, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap() - // .containsKey( - // FlutterFlowTheme.of(context) - // .bodyMediumFamily), - // ), - // ), - // ), - // ), - ].divide(const SizedBox(height: 5.0)), - ), - ] - .addToStart(const SizedBox(width: 10.0)) - .addToEnd(const SizedBox(width: 10.0)), - ), - // Padding( - // padding: const EdgeInsetsDirectional.fromSTEB( - // 24.0, 0.0, 24.0, 0.0), - // child: TextFormField( - // controller: _model.textController1, - // focusNode: _model.textFieldFocusNode1, - // autofocus: false, - // textInputAction: TextInputAction.next, - // readOnly: true, - // obscureText: false, - // decoration: InputDecoration( - // labelText: FFLocalizations.of(context).getText( - // 'ivfw4j04' /* Nome */, - // ), - // labelStyle: FlutterFlowTheme.of(context) - // .labelMedium - // .override( - // fontFamily: - // FlutterFlowTheme.of(context).labelMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).labelMediumFamily), - // ), - // hintStyle: FlutterFlowTheme.of(context) - // .labelMedium - // .override( - // fontFamily: - // FlutterFlowTheme.of(context).labelMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).labelMediumFamily), - // ), - // enabledBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).accent1, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // focusedBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).primary, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // errorBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).error, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // focusedErrorBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).error, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // suffixIcon: Icon( - // Icons.person, - // color: FlutterFlowTheme.of(context).accent1, - // ), - // ), - // style: FlutterFlowTheme.of(context).bodyMedium.override( - // fontFamily: - // FlutterFlowTheme.of(context).bodyMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).bodyMediumFamily), - // ), - // maxLines: null, - // keyboardType: TextInputType.name, - // validator: - // _model.textController1Validator.asValidator(context), - // ), - // ), - // Padding( - // padding: const EdgeInsetsDirectional.fromSTEB( - // 24.0, 0.0, 24.0, 0.0), - // child: TextFormField( - // controller: _model.textController2, - // focusNode: _model.textFieldFocusNode2, - // autofocus: false, - // textInputAction: TextInputAction.next, - // readOnly: true, - // obscureText: false, - // decoration: InputDecoration( - // labelText: FFLocalizations.of(context).getText( - // 'ndzkqehm' /* Motivo */, - // ), - // labelStyle: FlutterFlowTheme.of(context) - // .labelMedium - // .override( - // fontFamily: - // FlutterFlowTheme.of(context).labelMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).labelMediumFamily), - // ), - // hintStyle: FlutterFlowTheme.of(context) - // .labelMedium - // .override( - // fontFamily: - // FlutterFlowTheme.of(context).labelMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).labelMediumFamily), - // ), - // enabledBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).accent1, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // focusedBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).primary, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // errorBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).error, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // focusedErrorBorder: OutlineInputBorder( - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context).error, - // width: 0.5, - // ), - // borderRadius: BorderRadius.circular(10.0), - // ), - // suffixIcon: Icon( - // Icons.history_edu, - // color: FlutterFlowTheme.of(context).accent1, - // ), - // ), - // style: FlutterFlowTheme.of(context).bodyMedium.override( - // fontFamily: - // FlutterFlowTheme.of(context).bodyMediumFamily, - // color: FlutterFlowTheme.of(context).primaryText, - // letterSpacing: 0.0, - // useGoogleFonts: GoogleFonts.asMap().containsKey( - // FlutterFlowTheme.of(context).bodyMediumFamily), - // ), - // maxLines: null, - // keyboardType: TextInputType.name, - // validator: - // _model.textController2Validator.asValidator(context), - // ), - // ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - // controller: _model.textControllerStatus, - // focusNode: _model.textFieldFocusNodeStatus, - autofocus: false, - canRequestFocus: false, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0)), - filled: true, - fillColor: () { - if (widget.vawStatus == 'L') { - return FlutterFlowTheme.of(context).primary; - } else if (widget.vawStatus == 'B') { - return FlutterFlowTheme.of(context).error; - } else if (widget.vawStatus == 'S') { - return FlutterFlowTheme.of(context).warning; - } else { - return FlutterFlowTheme.of(context).warning; - } - }(), - labelText: () { - if (widget.vawStatus == 'L') { - return FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ); - } else if (widget.vawStatus == 'B') { - return FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ); - } else { - return FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ); - } - }(), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).accent1, + const SizedBox(height: 20.0), + Container( + width: 150.0, + height: 150.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + fit: BoxFit.cover, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController1Validator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'ivfw4j04' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController1Validator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'ndzkqehm' /* Motivo */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.history_edu, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController2Validator.asValidator(context), - ), - ), - if (widget.vawStatus != 'S') - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'kt87omsz' /* Mensagem */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .labelMediumFamily), + const SizedBox(height: 10.0), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 24.0), + child: TextFormField( + // controller: _model.textControllerStatus, + // focusNode: _model.textFieldFocusNodeStatus, + autofocus: false, + canRequestFocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + filled: true, + fillColor: item.value, + labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).accent1, + ), ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.message, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - validator: - _model.textController3Validator.asValidator(context), - ), - ), - if (widget.vawStatus != 'S') - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'yyni99pe' /* Data */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), + ), ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - validator: - _model.textController4Validator.asValidator(context), - ), - ), - - if (widget.vawStatus == 'S') - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 20.0, 24.0, 20.0), - child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'ssz899es' /* Pergunta */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.question_answer, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController5Validator.asValidator(context), - ), - ), - if (widget.vawStatus == 'S') - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - showLoadingIndicator: isLoaded, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).error, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - onPressed: () async { - await widget.changeStatusAction?.call( - context, - 'B', - widget.vawRef ?? '', - _model.textController5.text, - widget.vteUUID ?? '', ); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - showLoadingIndicator: isLoaded, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).success, - icon: Icon( - Icons.done, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - onPressed: () async { - await widget.changeStatusAction?.call( - context, - 'L', - widget.vawRef ?? '', - _model.textController5.text, - widget.vteUUID ?? '', - ); - }, - ), - ].divide(const SizedBox(width: 20.0)), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 20.0)) - .addToEnd(const SizedBox(height: 20.0)), + }).toList(); + }).toList(), + ), + const SizedBox(height: 10.0), + // ListView.builder( + // shrinkWrap: true, + // itemCount: labelsLinkedHashMap.length, + // physics: const NeverScrollableScrollPhysics(), + // itemBuilder: (context, index) { + // String key = labelsLinkedHashMap.keys.elementAt(index); + // String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + // }, + // ), + const SizedBox(height: 20.0), + ], + ), + ), ), ), - ), - ), + ); + }, ); } -} \ No newline at end of file +} diff --git a/lib/main.dart b/lib/main.dart index 2590c721..642f9e0b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,3 @@ - import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:hub/app_state.dart'; @@ -141,4 +140,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} \ No newline at end of file +} diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 3627c1b4..0bf40324 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -21,7 +21,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:provider/provider.dart'; - class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -258,11 +257,9 @@ Widget liberationDynamicListView( .where((item) => jsonToStr(getJsonField( item, r'''$.VTE_NOME''', - )) - .toLowerCase() - .contains( - _model.textController.text.toLowerCase(), - )) + )).toLowerCase().contains( + _model.textController.text.toLowerCase(), + )) .toList() : liberationHistory; @@ -309,26 +306,28 @@ Widget liberationHistoryItemCard( 'Data:': liberationHistoryItem['NOT_DTENVIO'], 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], }), - statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : liberationHistoryItem['NOT_STATUS'] == 'B' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - })], + statusHashMap: [ + liberationHistoryItem['NOT_STATUS'] == 'L' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).success, + }) + : liberationHistoryItem['NOT_STATUS'] == 'B' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context).warning, + }) + ], onTapCardItemAction: () async { showModalBottomSheet( isScrollControlled: true, @@ -352,6 +351,39 @@ Widget liberationHistoryItemCard( vawUUID: liberationHistoryItem['NOT_ID'], vawName: liberationHistoryItem['NOT_NOME'], vawRef: liberationHistoryItem['NOT_ID'], + labelsHashMap: Map.from({ + 'Nome:': liberationHistoryItem['VTE_NOME'], + 'Data:': liberationHistoryItem['NOT_DTENVIO'], + 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], + 'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'], + // 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'], + }), + statusHashMap: [ + liberationHistoryItem['NOT_STATUS'] == 'L' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).success, + }) + : liberationHistoryItem['NOT_STATUS'] == 'B' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context).warning, + }) + ], + imageHashMap: Map.from({ + 'key': liberationHistoryItem['VTE_ID'], + 'value': 'E', + }), changeStatusAction: changeStatusAction, // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], ); @@ -380,4 +412,4 @@ Widget liberationHistoryItemCard( }); }, ); -} \ No newline at end of file +} diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 8d9d7d5c..cdd4b9bc 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -239,6 +239,7 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Card( + color: FlutterFlowTheme.of(context).primaryBackground, child: Container( // height: 100, child: Padding( @@ -249,54 +250,65 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - mainAxisSize: MainAxisSize.max, + Column( children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 10, - color: FlutterFlowTheme.of(context).customColor6, - overflow: TextOverflow.ellipsis, - ), - ), - ), - ], - ), - Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 12, - color: FlutterFlowTheme.of(context).primary, - ), - overflow: TextOverflow.fade, - ), - ), Icon( jsonBody['MSG_DESTINO_TP'] == 'T' ? Icons.group : Icons.person, color: FlutterFlowTheme.of(context).primary, + size: 25, + ), + Icon( + Icons.history, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, ), ], ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + SizedBox(height: 4), + Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: FlutterFlowTheme.of(context).customColor6, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + ), ], ), SizedBox(height: 8), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - jsonBody['MSG_TEXTO'].toString(), - ), + Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + ), + ], ), SizedBox(height: 8), ], diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index d7c05015..c26d7ba6 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -52,7 +52,11 @@ class PreferencesPageModel with ChangeNotifier { void enablePerson(BuildContext context) { notifyListeners(); Share.share( - FFAppState().userDevUUID, + FFLocalizations.of(context).getVariableText( + ptText: + 'Este é o meu identificador de acesse: ${FFAppState().userDevUUID}', + enText: 'This is my access identifier: ${FFAppState().userDevUUID}', + ), ); } @@ -89,151 +93,335 @@ class PreferencesPageModel with ChangeNotifier { } void localUnlink(BuildContext context) { - PhpGroup.resopndeVinculo - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - tarefa: 'I', - ) - .catchError((err) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + title: Text( FFLocalizations.of(context).getVariableText( - enText: 'Error unlinking device', - ptText: 'Erro ao desvincular dispositivo', + enText: 'Unlink device', + ptText: 'Desvincular dispositivo', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).then( - (value) { - FFAppState().deleteCliUUID(); - FFAppState().deleteLocal(); - FFAppState().deleteOwnerUUID(); - Navigator.pop(context); - }, - ); + ), + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Are you sure you want to unlink this device?', + ptText: 'Tem certeza que deseja desvincular este dispositivo?', + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info), + ), + ), + TextButton( + onPressed: () { + PhpGroup.resopndeVinculo + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + tarefa: 'I', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + Navigator.pop(context); + }, + ); + notifyListeners(); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Unlink', + ptText: 'Desvincular', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info), + ), + ), + ], + ); + }); notifyListeners(); } void deleteAccount(BuildContext context) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Delete account', + ptText: 'Deletar conta', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Are you sure you want to delete your account?', + ptText: 'Tem certeza que deseja deletar sua conta?', + ), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info), + ), + ), + TextButton( + onPressed: () { + PhpGroup.deleteAccount + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ) + .then((value) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }).catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error deleting account', + ptText: 'Erro ao deletar conta', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); + notifyListeners(); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Delete', + ptText: 'Deletar', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info), + ), + ), + ], + ); + }); + notifyListeners(); + + // PhpGroup.deleteAccount + // .call( + // devUUID: FFAppState().devUUID, + // userUUID: FFAppState().userUUID, + // ) + // .then((value) { + // FFAppState().deleteAll(); + // FFAppState().isLogged = false; + // context.goNamed( + // 'welcomePage', + // extra: { + // kTransitionInfoKey: const TransitionInfo( + // hasTransition: true, + // transitionType: PageTransitionType.scale, + // alignment: Alignment.bottomCenter, + // ), + // }, + // ); + // }).catchError((err) { + // log(err.toString()); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar( + // content: Text( + // FFLocalizations.of(context).getVariableText( + // ptText: 'Erro ao deletar dispositivo', + // enText: 'Error deleting device', + // ), + // style: TextStyle(color: FlutterFlowTheme.of(context).info)), + // backgroundColor: FlutterFlowTheme.of(context).error, + // duration: const Duration(seconds: 3), + // behavior: SnackBarBehavior.floating, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(30), + // ), + // ), + // ); + // }); } Future togglePass(BuildContext context) async { debugPrint('pass: ${FFAppState().pass}'); - if (FFAppState().pass) { - FFAppState().pass = false; - FFAppState().deleteAccessPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().accessPass = key; - notifyListeners(); - debugPrint('key: $key'); - await PhpGroup.changePass - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - newSenha: FFAppState().accessPass, - ) - .then((value) { + // if (FFAppState().pass) { + // FFAppState().pass = false; + // FFAppState().deleteAccessPass(); + // notifyListeners(); + // } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().accessPass = key; + notifyListeners(); + debugPrint('key: $key'); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().accessPass, + ) + .then((value) { + FFAppState().pass = true; + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); + if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; - // var error = jsonDecode(value.jsonBody['error'].toString()); - // log('${jsonDecode(value.jsonBody['error'].toString())}'); - if (jsonDecode(value.jsonBody['error'].toString()) == false) { - FFAppState().pass = true; - } else { - FFAppState().pass = false; - } - }).onError((error, StackTrace) { + } else { FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); - }).whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); - } + } + }).catchError((error, StackTrace) { + FFAppState().pass = false; + log(error.toString()); + log(StackTrace.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar senha de acesso', + enText: 'Error changing access password', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + // } } Future togglePanic(BuildContext context) async { - if (FFAppState().panic) { - FFAppState().panic = false; - FFAppState().deletePanicPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().panicPass = key; - notifyListeners(); - await PhpGroup.changePass - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - newSenha: FFAppState().panicPass, - ) - .then((value) { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().panicPass = key; + notifyListeners(); + await PhpGroup.changePanic + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenhaPanico: FFAppState().panicPass, + ) + .then((value) { + FFAppState().panic = true; + if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().panic = true; - if (jsonDecode(value.jsonBody['error'].toString()) == false) { - FFAppState().panic = true; - } else { - FFAppState().panic = false; - } - }).onError((e, s) { + } else { FFAppState().panic = false; - log(e.toString()); - log(s.toString()); - }).whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); - } + } + }).catchError((e, s) { + FFAppState().panic = false; + + log(e.toString()); + log(s.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar senha de pânico', + enText: 'Error changing panic password', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); } @override diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 20874759..dd0ed8b4 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -6,8 +6,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; @@ -1675,544 +1678,236 @@ Widget visitHistory( color: FlutterFlowTheme.of(context).primaryBackground, ), child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ], + child: FutureBuilder( + future: _model.visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', ), - FutureBuilder( - future: _model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), ), - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - // visitaWrap.length, (visitaWrapIndex) { + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const BouncingScrollPhysics(), + addAutomaticKeepAlives: true, + cacheExtent: 1000.0, + addRepaintBoundaries: true, + addSemanticIndexes: true, + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + // visitaWrap.length, (visitaWrapIndex) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - useSafeArea: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: getJsonField( - visitaWrapItem, - r'''$.VAW_OBS''', - ).toString(), - visitorImgPath: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - visitorStrList: getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitStatusColor: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString() == - 'A' - ? FlutterFlowTheme.of(context).success - : FlutterFlowTheme.of(context).error, - visitorJsonList: - PhpGroup.getVisitsCall.visitasList( - wrapGetVisitsResponse.jsonBody, - ), - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Card( - clipBehavior: Clip.antiAliasWithSaveLayer, - color: - FlutterFlowTheme.of(context).primaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'i46frqyi' /* Visitante: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - '73b1kj59' /* Início em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'klzzrfbn' /* Fim em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme - .of(context) - .success; - } else if ((jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FlutterFlowTheme - .of(context) - .error; - } else if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme - .of(context) - .warning; - } else { - return FlutterFlowTheme - .of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - () { - if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Ativo', - enText: 'Active', - ); - } else if ((jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ); - } else { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ), - ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), + return CardItemTemplateComponentWidget( + imageHashMap: Map.from({ + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }), + labelsHashMap: Map.from({ + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }), + statusHashMap: [ + visitaWrapItem['VAW_STATUS'] == 'A' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).success, + }) + : visitaWrapItem['VAW_STATUS'] == 'F' || + visitaWrapItem['VAW_STATUS'] == 'B' || + visitaWrapItem['VAW_STATUS'] == 'C' || + visitaWrapItem['VAW_STATUS'] == 'I' + ? Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context).warning, + }) + : Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }), + ], + onTapCardItemAction: () async { + showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return VisitRequestTemplateComponentWidget( + vteName: 'Lorem Ipsus', + vteReason: 'Lorem Ipsus', + vawDate: 'Lorem Ipsus', + vawStatus: 'Lorem Ipsus', + vteMsg: 'Lorem Ipsus', + vteUUID: 'Lorem Ipsus', + cliUUID: FFAppState().cliUUID, + msgUUID: 'Lorem Ipsus', + vawDestino: 'Lorem Ipsus', + vawUUID: 'Lorem Ipsus', + vawName: 'Lorem Ipsus', + vawRef: 'Lorem Ipsus', + labelsHashMap: Map.from({ + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': + visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }), + imageHashMap: Map.from({ + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }), + statusHashMap: [ + visitaWrapItem['VAW_STATUS'] == 'A' + ? Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context) + .success, + }) + : visitaWrapItem['VAW_STATUS'] == 'F' || + visitaWrapItem['VAW_STATUS'] == + 'B' || + visitaWrapItem['VAW_STATUS'] == + 'C' || + visitaWrapItem['VAW_STATUS'] == + 'I' + ? Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context) + .warning, + }) + : Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context) + .error, + }), ], - ), - ), - ), - ); - }); - }, - ); + changeStatusAction: changeStatusAction, + // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], + ); + }, + ).then((_) { + // PushNotificationManager _pushNotificationService = + // PushNotificationManager(); + + // _pushNotificationService.onMessageReceived + // .listen((received) { + // if (received.data['click_action'] == + // 'cancel_request') { + // log('Aprovado'); + // _pushNotificationService.dispose(); + // snackbar(context, opt: true); + // context.pushReplacementNamed( + // 'liberationHistory', + // extra: { + // kTransitionInfoKey: const TransitionInfo( + // hasTransition: true, + // transitionType: PageTransitionType.scale, + // alignment: Alignment.bottomCenter, + // ), + // }, + // ); + // } + // }); + }); + + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: true, + // isDismissible: true, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model.unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: VisitDetailsModalTemplateComponentWidget( + // visitStatusStr: visitaWrapItem['VAW_STATUS'], + // visitStartDateStr: + // visitaWrapItem['VAW_DTINICIO'], + // visitEndDateStr: visitaWrapItem['VAW_DTFIM'], + // visitReasonStr: + // visitaWrapItem['MOT_DESCRICAO'], + // visitLevelStr: + // visitaWrapItem['NAC_DESCRICAO'], + // visitTempStr: + // visitaWrapItem['VTE_UNICA'].toString(), + // visitObsStr: visitaWrapItem['VAW_OBS'], + // visitorImgPath: valueOrDefault( + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitaWrapItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + // ), + // visitorStrList: + // visitaWrapItem['VTE_DOCUMENTO'], + // visitIdStr: visitaWrapItem['VAW_ID'], + // visitStatusColor: + // visitaWrapItem['VAW_STATUS'] == 'A' + // ? FlutterFlowTheme.of(context).success + // : FlutterFlowTheme.of(context).error, + // visitorJsonList: + // PhpGroup.getVisitsCall.visitasList( + // wrapGetVisitsResponse.jsonBody, + // ), + // updateToggleIdx: () async {}, + // repeatVisitSchedule: () async {}, + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }); + }); }, - ) - ], + ); + }, ), ), ); From 08e072e183678cd83aab1c2aab21cd510b6dc0ff Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Fri, 2 Aug 2024 11:18:09 -0300 Subject: [PATCH 14/72] WIP --- ...siter_vistor_template_component_model.dart | 2 + ...iter_vistor_template_component_widget.dart | 37 ++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index 6e812792..3e518237 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -37,6 +37,7 @@ class RegisiterVistorTemplateComponentModel Future getVisitanteByDocument( String document, BuildContext context) async { + final response = await PhpGroup.getVisitorByDocCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, @@ -44,6 +45,7 @@ class RegisiterVistorTemplateComponentModel atividade: 'getVisitante', documento: document, ); + log('${response.jsonBody}'); if (response.jsonBody['visitante']['VTE_ID'] != '0' && response.jsonBody['error'] != 'false') { diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 1ab51600..e18779eb 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -38,6 +38,8 @@ class _RegisiterVistorTemplateComponentWidgetState final scaffoldKey = GlobalKey(); + bool _isVisitorRegistered = false; + @override void initState() { super.initState(); @@ -71,6 +73,32 @@ class _RegisiterVistorTemplateComponentWidgetState setState(() {}); } + bool _isFormValid(BuildContext context) { + + if (_model.uploadedLocalFile.bytes?.isEmpty ?? true) { + return false; + } + + if (_model.textController1.text.isEmpty || _model.textController1.text == '') { + return false; + } + + if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') { + return false; + } + + if (_model.textController2.text.isEmpty || _model.textController2.text == '') { + return false; + } + + log("Visitante Já Cadastrado $_isVisitorRegistered"); + if (_isVisitorRegistered) { + return false; + } + + return true; + } + @override Widget build(BuildContext context) { BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); @@ -216,9 +244,11 @@ class _RegisiterVistorTemplateComponentWidgetState } else if (snapshot.hasError || snapshot.data == null || snapshot.data == '') { + _isVisitorRegistered = false; visitorAlreadyRegistered.add(true); return const SizedBox(); } else { + _isVisitorRegistered = true; visitorAlreadyRegistered.add(false); return _model.textController2.text.isEmpty ? const SizedBox() @@ -775,12 +805,7 @@ class _RegisiterVistorTemplateComponentWidgetState padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), child: FFButtonWidget( - onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) + onPressed: _isFormValid(context) ? () async { log(visitorAlreadyRegistered.value.toString()); if (visitorAlreadyRegistered.value == true) { From 561a128943abd8c1220bd97798c575381de90ffa Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 11:22:31 -0300 Subject: [PATCH 15/72] feat: Improve image upload functionality The code changes include fixes for image upload, renaming of a class, and improvements to message well, visitor register, and preferences pages. These changes aim to enhance the image upload functionality and ensure a smoother user experience. --- ...iter_vistor_template_component_widget.dart | 175 ++++++++---------- 1 file changed, 77 insertions(+), 98 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index e18779eb..1f06484d 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -364,100 +364,79 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Column( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - if (_model.dropDownValue == null || - _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ), - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - color: FlutterFlowTheme.of(context) - .customColor6, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodySmallFamily), - )), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 10.0), + child: Column( + children: [ + FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, ), - ], - ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: MediaQuery.sizeOf(context).width * 0.9, + // height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), + ), + ], ), ), Builder( @@ -502,11 +481,11 @@ class _RegisiterVistorTemplateComponentWidgetState allowPhoto: true, includeDimensions: true, ); - if (selectedMedia != null){ - // && - // selectedMedia.every((m) => - // validateFileFormat( - // m.storagePath, context))) { + if (selectedMedia != null) { + // && + // selectedMedia.every((m) => + // validateFileFormat( + // m.storagePath, context))) { setState(() => _model.isDataUploading = true); var selectedUploadedFiles = []; From 03bd74705025a9c052d628522fb14c729daf9a8a Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 12:15:15 -0300 Subject: [PATCH 16/72] WIP --- ...regisiter_vistor_template_component_widget.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 1f06484d..5ea36575 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -74,20 +74,23 @@ class _RegisiterVistorTemplateComponentWidgetState } bool _isFormValid(BuildContext context) { - if (_model.uploadedLocalFile.bytes?.isEmpty ?? true) { return false; } - if (_model.textController1.text.isEmpty || _model.textController1.text == '') { + if (_model.textController1.text.isEmpty || + _model.textController1.text == '') { return false; } - if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') { + if (_model.dropDownValue == null || + _model.dropDownValue!.isEmpty || + _model.dropDownValue == '') { return false; } - if (_model.textController2.text.isEmpty || _model.textController2.text == '') { + if (_model.textController2.text.isEmpty || + _model.textController2.text == '') { return false; } @@ -244,11 +247,12 @@ class _RegisiterVistorTemplateComponentWidgetState } else if (snapshot.hasError || snapshot.data == null || snapshot.data == '') { + safeSetState(() => _isVisitorRegistered = false); _isVisitorRegistered = false; visitorAlreadyRegistered.add(true); return const SizedBox(); } else { - _isVisitorRegistered = true; + safeSetState(() => _isVisitorRegistered = true); visitorAlreadyRegistered.add(false); return _model.textController2.text.isEmpty ? const SizedBox() From 12c334bdd0284ca4aebf5cf6e17be9186fd8e04a Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 12:28:22 -0300 Subject: [PATCH 17/72] WIP --- .../message_history_page_widget.dart | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index cdd4b9bc..217a73a8 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -172,23 +172,21 @@ Widget liberationDynamicListView( height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getMessagesCall - .call( - devUUID: FFAppState().devUUID.toString(), - userUUID: FFAppState().userUUID.toString(), - cliID: FFAppState().cliUUID.toString(), - atividade: 'getMensagens', - pageSize: '100', - pageNumber: '1', - tipoDestino: DestIndex, - ) - .catchError((error) { - log('Error: ${error.toString()}'); - return Future.delayed(Duration(seconds: 1), () { - return Center( - child: Text('Erro ao carregar mensagens'), + future: Future(() async { + try { + return await PhpGroup.getMessagesCall.call( + devUUID: FFAppState().devUUID.toString(), + userUUID: FFAppState().userUUID.toString(), + cliID: FFAppState().cliUUID.toString(), + atividade: 'getMensagens', + pageSize: '100', + pageNumber: '1', + tipoDestino: DestIndex, ); - }); + } catch (error) { + log('Error: ${error.toString()}'); + throw error; + } }), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { From 5b9e11da5a7b1e3b5a09529514e9ed6a0b98f9d7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 13:03:09 -0300 Subject: [PATCH 18/72] WIP --- .../message_history_page_widget.dart | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 217a73a8..7d141108 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -171,10 +171,10 @@ Widget liberationDynamicListView( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), - child: FutureBuilder( + child: FutureBuilder( future: Future(() async { try { - return await PhpGroup.getMessagesCall.call( + var response = await PhpGroup.getMessagesCall.call( devUUID: FFAppState().devUUID.toString(), userUUID: FFAppState().userUUID.toString(), cliID: FFAppState().cliUUID.toString(), @@ -183,9 +183,10 @@ Widget liberationDynamicListView( pageNumber: '1', tipoDestino: DestIndex, ); + return response.jsonBody; } catch (error) { log('Error: ${error.toString()}'); - throw error; + return {'mensagens': [], 'total_rows': 0}; } }), builder: (context, snapshot) { @@ -201,15 +202,18 @@ Widget liberationDynamicListView( ), ); } - if (snapshot.hasError == true || snapshot.data == null) { + if (snapshot.hasError == true || + snapshot.data == null || + !snapshot.hasData || + snapshot.hasError) { log('Error: ${snapshot.error.toString()}'); // log('Error: ${snapshot.data!.jsonBody['mensagens']}'); return const Center( child: Text('Erro ao carregar mensagens'), ); } - final mensagens = snapshot.data!.jsonBody['mensagens']; - final totalRows = snapshot.data!.jsonBody['total_rows']; + final mensagens = snapshot.data!['mensagens']; + final totalRows = snapshot.data!['total_rows']; if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { return const Center( child: Text('Nenhuma mensagem encontrada'), @@ -223,7 +227,7 @@ Widget liberationDynamicListView( itemBuilder: (BuildContext context, int index) { return messageHistoryItem( context, - snapshot.data!.jsonBody['mensagens'][index], + snapshot.data!['mensagens'][index], ); }, ); From 2609f1bdda7b4b1221000dcf84acc1fb7e90ea64 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 13:20:14 -0300 Subject: [PATCH 19/72] WIP --- .../message_history_page_widget.dart | 73 ++++++++++--------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 7d141108..264adb72 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -249,32 +249,24 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).primary, - size: 25, - ), - Icon( - Icons.history, - color: FlutterFlowTheme.of(context).customColor6, - size: 15, - ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + size: 25, + ), + Expanded( + child: Text( jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle( fontWeight: FontWeight.bold, @@ -283,21 +275,36 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { ), overflow: TextOverflow.fade, ), - SizedBox(height: 4), - Text( + ), + ].divide(const SizedBox(width: 10)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.history, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( jsonBody['MSG_DATE'].toString(), style: TextStyle( fontWeight: FontWeight.bold, fontSize: 10, color: FlutterFlowTheme.of(context).customColor6, - overflow: TextOverflow.ellipsis, ), + overflow: TextOverflow.ellipsis, ), - ], - ), + ), + ].divide(const SizedBox(width: 20)), ), - ), - ], + ].divide(const SizedBox(height: 4)), + ), ), SizedBox(height: 8), Row( From 2f8ce24295474d18fb2eb572d524a0a34181d6cc Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 13:48:34 -0300 Subject: [PATCH 20/72] fix: layout MessageItem and throw exception --- .../message_history_page_widget.dart | 185 ++++++++++-------- 1 file changed, 105 insertions(+), 80 deletions(-) diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 264adb72..c4f70c8d 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -239,91 +239,116 @@ Widget liberationDynamicListView( Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Card( - color: FlutterFlowTheme.of(context).primaryBackground, - child: Container( - // height: 100, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).primary, - size: 25, - ), - Expanded( - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 15, - color: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + color: FlutterFlowTheme.of(context).primaryBackground, + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + size: 25, + ), + Expanded( + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, ), - overflow: TextOverflow.fade, ), - ), - ].divide(const SizedBox(width: 10)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.only(left: 5), - child: Icon( - Icons.history, - color: FlutterFlowTheme.of(context).customColor6, - size: 15, - ), - ), - Expanded( - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 10, - color: FlutterFlowTheme.of(context).customColor6, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ].divide(const SizedBox(width: 20)), - ), - ].divide(const SizedBox(height: 4)), - ), - ), - SizedBox(height: 8), - Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - jsonBody['MSG_TEXTO'].toString(), + ].divide(const SizedBox(width: 10)), ), - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.history, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: + FlutterFlowTheme.of(context).customColor6, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ].divide(const SizedBox(width: 15)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.message, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + ].divide(const SizedBox(width: 15)), + ), + ].divide(const SizedBox(height: 4)), ), - ], + ), + // Row( + // children: [ + // Icon( + // Icons.message, + // color: FlutterFlowTheme.of(context).customColor6, + // size: 15, + // ), + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Text( + // jsonBody['MSG_TEXTO'].toString(), + // ), + // ), + // ), + // ] + // .addToStart(const SizedBox(width: 8)) + // .addToEnd(const SizedBox(width: 8))), + ].divide( + const SizedBox(height: 8), ), - SizedBox(height: 8), - ], + ), ), ), - ), - ), - ); + )); } From 823b02ade6d3acc7f9eede4e734d5b7ac70adc29 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 13:58:05 -0300 Subject: [PATCH 21/72] WIP --- .../regisiter_vistor_template_component_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 5ea36575..3440eb7b 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -247,12 +247,12 @@ class _RegisiterVistorTemplateComponentWidgetState } else if (snapshot.hasError || snapshot.data == null || snapshot.data == '') { - safeSetState(() => _isVisitorRegistered = false); + // safeSetState(() => _isVisitorRegistered = false); _isVisitorRegistered = false; visitorAlreadyRegistered.add(true); return const SizedBox(); } else { - safeSetState(() => _isVisitorRegistered = true); + _isVisitorRegistered = true; visitorAlreadyRegistered.add(false); return _model.textController2.text.isEmpty ? const SizedBox() From ae698a276d47fedbd5074593a421af9b65087bc9 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 14:14:35 -0300 Subject: [PATCH 22/72] fix: preferences settings --- .../preferences_settings_model.dart | 138 +++++++++++++++++- 1 file changed, 131 insertions(+), 7 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index c26d7ba6..a27db0b9 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -45,7 +45,43 @@ class PreferencesPageModel with ChangeNotifier { ), ); }, - ).whenComplete(() => notifyListeners()); + ).then((value) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Fingerprint changed successfully', + ptText: 'Impressão digital alterada com sucesso', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).catchError((err, stack) { + log(err.toString()); + log(stack.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar impressão digital', + enText: 'Error changing fingerprint', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); } } @@ -70,7 +106,24 @@ class PreferencesPageModel with ChangeNotifier { atividade: 'updVisitado', notifica: FFAppState().notify ? 'S' : 'N', ) - .catchError((err) { + .then((value) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Notificação alterada com sucesso', + enText: 'Notification changed successfully', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).catchError((err) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( @@ -120,7 +173,8 @@ class PreferencesPageModel with ChangeNotifier { enText: 'Cancel', ptText: 'Cancelar', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText), ), ), TextButton( @@ -167,7 +221,8 @@ class PreferencesPageModel with ChangeNotifier { enText: 'Unlink', ptText: 'Desvincular', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText), ), ), ], @@ -202,7 +257,8 @@ class PreferencesPageModel with ChangeNotifier { enText: 'Cancel', ptText: 'Cancelar', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText), ), ), TextButton( @@ -252,7 +308,8 @@ class PreferencesPageModel with ChangeNotifier { enText: 'Delete', ptText: 'Deletar', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText), ), ), ], @@ -328,12 +385,45 @@ class PreferencesPageModel with ChangeNotifier { newSenha: FFAppState().accessPass, ) .then((value) { - FFAppState().pass = true; // var error = jsonDecode(value.jsonBody['error'].toString()); // log('${jsonDecode(value.jsonBody['error'].toString())}'); if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Access password changed successfully', + ptText: 'Senha de acesso alterada com sucesso', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); } else { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar senha de acesso', + enText: 'Error changing access password', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); FFAppState().pass = false; } }).catchError((error, StackTrace) { @@ -391,7 +481,41 @@ class PreferencesPageModel with ChangeNotifier { FFAppState().panic = true; if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().panic = true; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Panic password changed successfully', + ptText: 'Senha de pânico alterada com sucesso', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); } else { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar senha de pânico', + enText: 'Error changing panic password', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); FFAppState().panic = false; } }).catchError((e, s) { From 3556493ce0ce0507e7d0cc5e0f64f6009b4b1f68 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 15:11:59 -0300 Subject: [PATCH 23/72] chore: Update eva_icons_flutter dependency to version 3.1.0 --- .../pushNotificationService.dart | 1 + ...sit_request_template_component_widget.dart | 225 +++++++++--------- .../message_history_page_widget.dart | 7 +- pubspec.lock | 8 + pubspec.yaml | 23 +- 5 files changed, 134 insertions(+), 130 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index df5bfab7..a9224dc3 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -417,6 +417,7 @@ class NotificationHandler { log('Showing visit request notification dialog'); showDialog( context: context, + barrierDismissible: true, builder: (BuildContext context) { _getIdBasedOnUserType(message); return Dialog( diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index 8211b6e9..a95cf428 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -145,133 +145,130 @@ class _VisitRequestTemplateComponentWidgetState return LayoutBuilder( builder: (context, constraints) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Container( - width: constraints.maxWidth, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - const SizedBox(height: 20.0), - Container( - width: 150.0, - height: 150.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', - fit: BoxFit.cover, - ), + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Container( + width: constraints.maxWidth, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox(height: 20.0), + Container( + width: 150.0, + height: 150.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), - const SizedBox(height: 10.0), - Row( - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries - .map((MapEntry item) { - return Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 24.0), - child: TextFormField( - // controller: _model.textControllerStatus, - // focusNode: _model.textFieldFocusNodeStatus, - autofocus: false, - canRequestFocus: false, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - ), - filled: true, - fillColor: item.value, - labelText: item.key, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).accent1, - ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + fit: BoxFit.cover, + ), + ), + const SizedBox(height: 10.0), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 24.0), + child: TextFormField( + // controller: _model.textControllerStatus, + // focusNode: _model.textFieldFocusNodeStatus, + autofocus: false, + canRequestFocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), ), - style: FlutterFlowTheme.of(context) - .bodyMedium + filled: true, + fillColor: item.value, + labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, color: FlutterFlowTheme.of(context) .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).accent1, + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), ), - ); - }).toList(); - }).toList(), - ), - const SizedBox(height: 10.0), - // ListView.builder( - // shrinkWrap: true, - // itemCount: labelsLinkedHashMap.length, - // physics: const NeverScrollableScrollPhysics(), - // itemBuilder: (context, index) { - // String key = labelsLinkedHashMap.keys.elementAt(index); - // String value = labelsLinkedHashMap[key]!; - // return Text('key: $key, value: $value'); - // }, - // ), - const SizedBox(height: 20.0), - ], - ), + ), + ); + }).toList(); + }).toList(), + ), + const SizedBox(height: 10.0), + // ListView.builder( + // shrinkWrap: true, + // itemCount: labelsLinkedHashMap.length, + // physics: const NeverScrollableScrollPhysics(), + // itemBuilder: (context, index) { + // String key = labelsLinkedHashMap.keys.elementAt(index); + // String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + // }, + // ), + const SizedBox(height: 20.0), + ], ), ), ), diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index c4f70c8d..7f242130 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,6 +2,7 @@ import 'dart:developer'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; @@ -260,8 +261,10 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { children: [ Icon( jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, + ? EvaIcons.globe + : jsonBody['MSG_DESTINO_TP'] == 'P' + ? Icons.person + : Icons.home, color: FlutterFlowTheme.of(context).primary, size: 25, ), diff --git a/pubspec.lock b/pubspec.lock index db941ddb..d60bd97b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -233,6 +233,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.5" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + sha256: "6d48a10b93590ab83eb092bee5adacdeb14f3d83f527a4b9e4092c363d56e2a8" + url: "https://pub.dev" + source: hosted + version: "3.1.0" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8efce314..828e33cd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -29,7 +29,7 @@ dependencies: barcode_widget: 2.0.3 cached_network_image: 3.3.1 firebase_core: 3.1.0 - flutter_inappwebview: ^6.0.0 + flutter_inappwebview: ^6.0.0 webview_flutter: ^4.8.0 rxdart: ^0.27.7 collection: 1.18.0 @@ -49,6 +49,7 @@ dependencies: flutter_plugin_android_lifecycle: 2.0.20 share_plus: ^9.0.0 flutter_secure_storage: 9.2.2 + eva_icons_flutter: ^3.1.0 flutter_secure_storage_linux: 1.2.1 flutter_secure_storage_macos: 3.1.2 flutter_secure_storage_platform_interface: 1.1.2 @@ -87,7 +88,7 @@ dependencies: shared_preferences_web: 2.3.0 sqflite: 2.3.3+1 synchronized: 3.1.0+1 - responsive_framework: 1.4.0 + responsive_framework: 1.4.0 timeago: 3.6.1 url_launcher: 6.3.0 url_launcher_android: 6.3.3 @@ -99,7 +100,6 @@ dependencies: video_player_platform_interface: 6.2.2 video_player_web: 2.3.1 - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 @@ -123,24 +123,20 @@ dev_dependencies: flutter_test: sdk: flutter - flutter_launcher_icons: - android: 'launcher_icon' + android: "launcher_icon" ios: true web: generate: true - image_path: 'assets/images/app_launcher_icon.svg' - adaptive_icon_background: 'assets/images/adaptive_background_icon.svg' - adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg' - - + image_path: "assets/images/app_launcher_icon.svg" + adaptive_icon_background: "assets/images/adaptive_background_icon.svg" + adaptive_icon_foreground: "assets/images/adaptive_foreground_icon.svg" # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. @@ -158,7 +154,7 @@ flutter: - assets/rive_animations/ - assets/pdfs/ fonts: - - family: 'SF Pro' + - family: "SF Pro" fonts: - asset: assets/fonts/SFPRODISPLAYREGULAR.OTF - asset: assets/fonts/SFPRODISPLAYMEDIUM.OTF @@ -173,7 +169,6 @@ flutter: fonts: - asset: assets/fonts/menu.ttf - # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From da0e6b87b1d9fe72a222bab9a243410c72aab263 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 16:05:50 -0300 Subject: [PATCH 24/72] WIP --- ...dex.dart => .tool-versions:Zone.Identifier | 0 .../index.dart => README.md:Zone.Identifier | 0 ...t => analysis_options.yaml:Zone.Identifier | 0 .../.gitignore:Zone.Identifier | 0 .../app/build.gradle:Zone.Identifier | 0 .../app/google-services.json:Zone.Identifier | 0 .../debug/AndroidManifest.xml:Zone.Identifier | 0 android/app/src/main/AndroidManifest.xml | 2 +- .../main/AndroidManifest.xml:Zone.Identifier | 0 .../MainActivity.kt:Zone.Identifier | 0 .../drawable/ic_fre_black.png:Zone.Identifier | 0 .../launch_background.xml:Zone.Identifier | 0 .../mipmap/ic_fre_black.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../styles.xml:Zone.Identifier | 0 .../values-night/styles.xml:Zone.Identifier | 0 .../res/values-v31/styles.xml:Zone.Identifier | 0 .../res/values/strings.xml:Zone.Identifier | 0 .../res/values/styles.xml:Zone.Identifier | 0 .../AndroidManifest.xml:Zone.Identifier | 0 .../build.gradle:Zone.Identifier | 0 .../gradle.properties:Zone.Identifier | 0 .../gradle-wrapper.properties:Zone.Identifier | 0 .../settings.gradle:Zone.Identifier | 0 .../audios/favicon.png:Zone.Identifier | 0 .../fonts/Nunito-Medium.ttf:Zone.Identifier | 0 .../fonts/Nunito-Regular.ttf:Zone.Identifier | 0 .../SFPRODISPLAYBOLD.OTF:Zone.Identifier | 0 .../SFPRODISPLAYMEDIUM.OTF:Zone.Identifier | 0 .../SFPRODISPLAYREGULAR.OTF:Zone.Identifier | 0 .../fonts/favicon.png:Zone.Identifier | 0 .../fonts/icons.ttf:Zone.Identifier | 0 .../fonts/menu.ttf:Zone.Identifier | 0 ...aptive_background_icon.svg:Zone.Identifier | 0 ...aptive_foreground_icon.svg:Zone.Identifier | 0 .../app_launcher_icon.svg:Zone.Identifier | 0 .../images/dark/login.svg:Zone.Identifier | 0 assets/images/dark/register.svg | 29 + .../images/dark/register.svg:Zone.Identifier | 0 .../images/dark/welcome.svg:Zone.Identifier | 0 .../images/error_image.svg:Zone.Identifier | 0 .../images/favicon.png:Zone.Identifier | 0 .../images/light/login.svg:Zone.Identifier | 0 assets/images/light/register.svg | 35 + .../images/light/register.svg:Zone.Identifier | 0 .../images/light/welcome.svg:Zone.Identifier | 0 .../images/logo.svg:Zone.Identifier | 0 assets/images/welcome.svg | 30 - .../favicon.png:Zone.Identifier | 0 .../pdfs/favicon.png:Zone.Identifier | 0 .../favicon.png:Zone.Identifier | 0 .../videos/favicon.png:Zone.Identifier | 0 ...t => devtools_options.yaml:Zone.Identifier | 0 ...ndex.dart => firebase.json:Zone.Identifier | 0 .../.gitignore:Zone.Identifier | 0 ios/Flutter/AppFrameworkInfo.plist | 2 +- .../AppFrameworkInfo.plist:Zone.Identifier | 0 .../Flutter/Debug.xcconfig:Zone.Identifier | 0 .../Flutter/Release.xcconfig:Zone.Identifier | 0 .../Info.plist:Zone.Identifier | 0 .../NotificationService.swift:Zone.Identifier | 0 ios/Podfile | 2 +- ios/Podfile.lock | 46 +- .../Podfile.lock:Zone.Identifier | 0 .../index.dart => ios/Podfile:Zone.Identifier | 0 ios/Runner.xcodeproj/project.pbxproj | 10 +- .../project.pbxproj:Zone.Identifier | 0 .../contents.xcworkspacedata:Zone.Identifier | 0 .../IDEWorkspaceChecks.plist:Zone.Identifier | 0 ...rkspaceSettings.xcsettings:Zone.Identifier | 0 .../xcschemes/Runner.xcscheme:Zone.Identifier | 0 .../contents.xcworkspacedata:Zone.Identifier | 0 .../IDEWorkspaceChecks.plist:Zone.Identifier | 0 ...rkspaceSettings.xcsettings:Zone.Identifier | 0 .../Runner/AppDelegate.swift:Zone.Identifier | 0 .../100.png:Zone.Identifier | 0 .../1024.png:Zone.Identifier | 0 .../114.png:Zone.Identifier | 0 .../120.png:Zone.Identifier | 0 .../128.png:Zone.Identifier | 0 .../144.png:Zone.Identifier | 0 .../152.png:Zone.Identifier | 0 .../AppIcon.appiconset/16.png:Zone.Identifier | 0 .../167.png:Zone.Identifier | 0 .../180.png:Zone.Identifier | 0 .../AppIcon.appiconset/20.png:Zone.Identifier | 0 .../256.png:Zone.Identifier | 0 .../AppIcon.appiconset/29.png:Zone.Identifier | 0 .../AppIcon.appiconset/32.png:Zone.Identifier | 0 .../AppIcon.appiconset/40.png:Zone.Identifier | 0 .../AppIcon.appiconset/50.png:Zone.Identifier | 0 .../512.png:Zone.Identifier | 0 .../AppIcon.appiconset/57.png:Zone.Identifier | 0 .../AppIcon.appiconset/58.png:Zone.Identifier | 0 .../AppIcon.appiconset/60.png:Zone.Identifier | 0 .../AppIcon.appiconset/64.png:Zone.Identifier | 0 .../AppIcon.appiconset/72.png:Zone.Identifier | 0 .../AppIcon.appiconset/76.png:Zone.Identifier | 0 .../AppIcon.appiconset/80.png:Zone.Identifier | 0 .../AppIcon.appiconset/87.png:Zone.Identifier | 0 .../Contents.json:Zone.Identifier | 0 .../69 1.png:Zone.Identifier | 0 .../69 2.png:Zone.Identifier | 0 .../69.png:Zone.Identifier | 0 .../Contents.json:Zone.Identifier | 0 .../README.md:Zone.Identifier | 0 .../appstore.png:Zone.Identifier | 0 .../playstore.png:Zone.Identifier | 0 .../LaunchScreen.storyboard:Zone.Identifier | 0 .../Main.storyboard:Zone.Identifier | 0 .../GoogleService-Info.plist:Zone.Identifier | 0 ios/Runner/Info.plist:Zone.Identifier | 0 .../PrivacyInfo.xcprivacy:Zone.Identifier | 0 .../Runner-Bridging-Header.h:Zone.Identifier | 0 .../Runner.entitlements:Zone.Identifier | 0 .../InfoPlist.strings:Zone.Identifier | 0 .../InfoPlist.strings:Zone.Identifier | 0 lib/actions/actions.dart | 781 ++++++ lib/actions/actions.dart:Zone.Identifier | 0 lib/app_state.dart | 58 +- lib/app_state.dart:Zone.Identifier | 0 .../api_requests}/api_calls.dart | 5 +- .../api_calls.dart:Zone.Identifier | 0 .../api_requests}/api_manager.dart | 7 +- .../api_manager.dart:Zone.Identifier | 0 .../api_requests}/get_streamed_response.dart | 2 +- ...get_streamed_response.dart:Zone.Identifier | 0 .../pushNotificationService.dart | 32 +- ...shNotificationService.dart:Zone.Identifier | 0 .../tapNotifcationActivity.dart | 2 +- ...apNotifcationActivity.dart:Zone.Identifier | 0 .../schema/enums/enums.dart | 2 +- .../schema/enums/enums.dart:Zone.Identifier | 0 .../schema/structs/device_struct.dart | 7 +- .../device_struct.dart:Zone.Identifier | 0 lib/backend/schema/structs/index.dart | 3 + .../schema/structs/index.dart:Zone.Identifier | 0 .../schema/util/schema_util.dart | 8 +- .../util/schema_util.dart:Zone.Identifier | 0 lib/commons/actions/actions.dart | 814 ------ .../atoms/menu_card_item/widget.dart | 109 - .../molecules/menu_item/widget.dart | 11 - .../molecules/menu_staggered_view/widget.dart | 1082 -------- .../components/organisms/menu/widget.dart | 217 -- .../templates/exception/widget.dart | 163 -- lib/commons/schema/structs/index.dart | 3 - .../menu_button_item_widget.dart} | 11 +- ...nu_button_item_widget.dart:Zone.Identifier | 0 .../menu_card_item/menu_card_item.dart | 110 + .../menu_card_item.dart:Zone.Identifier | 0 .../atom_image_svg_theme.dart | 14 +- .../atom_image_svg_theme.dart:Zone.Identifier | 0 .../text_field_component_model.dart} | 7 +- ...field_component_model.dart:Zone.Identifier | 0 .../text_field_component_widget.dart} | 13 +- ...ield_component_widget.dart:Zone.Identifier | 0 .../menu_item/menu_item.dart | 19 + .../menu_item/menu_item.dart:Zone.Identifier | 0 .../message_opt_modal/opt_modal_model.dart} | 9 +- .../opt_modal_model.dart:Zone.Identifier | 0 .../message_opt_modal/opt_modal_widget.dart} | 15 +- .../opt_modal_widget.dart:Zone.Identifier | 0 .../opt_modal/opt_modal_model.dart} | 10 +- .../opt_modal_model.dart:Zone.Identifier | 0 .../opt_modal/opt_modal_widget.dart} | 13 +- .../opt_modal_widget.dart:Zone.Identifier | 0 .../option_selection_modal_model.dart} | 8 +- ...selection_modal_model.dart:Zone.Identifier | 0 .../option_selection_modal_widget.dart} | 13 +- ...election_modal_widget.dart:Zone.Identifier | 0 .../throw_exception_model.dart} | 8 +- ...throw_exception_model.dart:Zone.Identifier | 0 .../throw_exception_widget.dart | 175 ++ ...hrow_exception_widget.dart:Zone.Identifier | 0 .../visitor_not_found_component_model.dart} | 9 +- ...found_component_model.dart:Zone.Identifier | 0 .../visitor_not_found_component_widget.dart | 179 ++ ...ound_component_widget.dart:Zone.Identifier | 0 .../arrow_linked_locals_component_model.dart} | 9 +- ...ocals_component_model.dart:Zone.Identifier | 0 ...arrow_linked_locals_component_widget.dart} | 8 +- ...cals_component_widget.dart:Zone.Identifier | 0 ..._arrow_linked_locals_component_model.dart} | 9 +- ...ocals_component_model.dart:Zone.Identifier | 0 ..._arrow_linked_locals_component_widget.dart | 293 ++ ...cals_component_widget.dart:Zone.Identifier | 0 .../local_profile_component_model.dart} | 9 +- ...ofile_component_model.dart:Zone.Identifier | 0 .../local_profile_component_widget.dart} | 19 +- ...file_component_widget.dart:Zone.Identifier | 0 .../menu_component/menu_component_model.dart} | 14 +- .../menu_component_model.dart:Zone.Identifier | 0 .../menu_component/menu_component_widget.dart | 165 ++ ...menu_component_widget.dart:Zone.Identifier | 0 .../menu_list_view_component_model.dart} | 8 +- ..._view_component_model.dart:Zone.Identifier | 0 .../menu_list_view_component_widget.dart} | 84 +- ...view_component_widget.dart:Zone.Identifier | 0 .../menu_staggered_view_component_model.dart} | 6 +- ..._view_component_model.dart:Zone.Identifier | 0 .../menu_staggered_view_component_widget.dart | 157 ++ ...view_component_widget.dart:Zone.Identifier | 0 .../message_well_component_model.dart} | 15 +- ..._well_component_model.dart:Zone.Identifier | 0 .../message_well_component_widget.dart} | 13 +- ...well_component_widget.dart:Zone.Identifier | 0 .../schedule_visit_detail_model.dart} | 39 +- ...le_visit_detail_model.dart:Zone.Identifier | 0 .../schedule_visit_detail_widget.dart | 845 ++++++ ...e_visit_detail_widget.dart:Zone.Identifier | 0 ..._arrow_linked_locals_component_model.dart} | 9 +- ...ocals_component_model.dart:Zone.Identifier | 0 ...arrow_linked_locals_component_widget.dart} | 16 +- ...cals_component_widget.dart:Zone.Identifier | 0 ...ation_modal_template_component_model.dart} | 9 +- ...plate_component_model.dart:Zone.Identifier | 0 ...tion_modal_template_component_widget.dart} | 13 +- ...late_component_widget.dart:Zone.Identifier | 0 .../card_item_template_component_model.dart} | 7 +- ...plate_component_model.dart:Zone.Identifier | 0 .../card_item_template_component_widget.dart} | 13 +- ...late_component_widget.dart:Zone.Identifier | 0 .../change_pass_model.dart} | 7 +- .../change_pass_model.dart:Zone.Identifier | 0 .../change_pass_widget.dart} | 15 +- .../change_pass_widget.dart:Zone.Identifier | 0 ...got_password_template_component_model.dart | 47 + ...plate_component_model.dart:Zone.Identifier | 0 ...ot_password_template_component_widget.dart | 317 +++ ...late_component_widget.dart:Zone.Identifier | 0 ...tem_details_template_component_model.dart} | 13 +- ...plate_component_model.dart:Zone.Identifier | 0 ...em_details_template_component_widget.dart} | 12 +- ...late_component_widget.dart:Zone.Identifier | 0 .../message_notification_model.dart} | 12 +- ...ge_notification_model.dart:Zone.Identifier | 0 .../message_notification_widget.dart} | 13 +- ...e_notification_widget.dart:Zone.Identifier | 0 ...de_pass_key_template_component_model.dart} | 4 +- ...plate_component_model.dart:Zone.Identifier | 0 ...e_pass_key_template_component_widget.dart} | 17 +- ...late_component_widget.dart:Zone.Identifier | 0 ...siter_vistor_template_component_model.dart | 149 ++ ...plate_component_model.dart:Zone.Identifier | 0 ...ter_vistor_template_component_widget.dart} | 1141 ++++---- ...late_component_widget.dart:Zone.Identifier | 0 .../sign_in_template_component_model.dart | 62 + ...plate_component_model.dart:Zone.Identifier | 0 .../sign_in_template_component_widget.dart} | 400 ++- ...late_component_widget.dart:Zone.Identifier | 0 .../sign_up_template_component_model.dart | 96 + ...plate_component_model.dart:Zone.Identifier | 0 .../sign_up_template_component_widget.dart} | 223 +- ...late_component_widget.dart:Zone.Identifier | 0 .../view_visit_detail_model.dart} | 7 +- ...ew_visit_detail_model.dart:Zone.Identifier | 0 .../view_visit_detail_widget.dart} | 59 +- ...w_visit_detail_widget.dart:Zone.Identifier | 0 ...tails_modal_template_component_model.dart} | 11 +- ...plate_component_model.dart:Zone.Identifier | 0 ...tails_modal_template_component_widget.dart | 117 + ...late_component_widget.dart:Zone.Identifier | 0 ...sit_request_template_component_model.dart} | 8 +- ...plate_component_model.dart:Zone.Identifier | 0 ...it_request_template_component_widget.dart} | 13 +- ...late_component_widget.dart:Zone.Identifier | 0 ...tails_modal_template_component_model.dart} | 4 +- ...plate_component_model.dart:Zone.Identifier | 0 ...tails_modal_template_component_widget.dart | 284 ++ ...late_component_widget.dart:Zone.Identifier | 0 ...earch_modal_template_component_model.dart} | 10 +- ...plate_component_model.dart:Zone.Identifier | 0 ...earch_modal_template_component_widget.dart | 482 ++++ ...late_component_widget.dart:Zone.Identifier | 0 .../welcome_template_component_model.dart | 13 + ...plate_component_model.dart:Zone.Identifier | 0 .../welcome_template_component_widget.dart} | 27 +- ...late_component_widget.dart:Zone.Identifier | 0 .../actions/convert_image_file_to_base64.dart | 12 +- ..._image_file_to_base64.dart:Zone.Identifier | 0 .../actions/convert_to_upload_file.dart | 15 +- ...onvert_to_upload_file.dart:Zone.Identifier | 0 .../actions/get_dev_u_u_i_d.dart | 17 +- .../get_dev_u_u_i_d.dart:Zone.Identifier | 0 .../actions/index.dart | 3 - .../actions/index.dart:Zone.Identifier | 0 .../widgets/image_cropper.dart | 8 +- .../image_cropper.dart:Zone.Identifier | 0 .../widgets/index.dart | 0 .../widgets/index.dart:Zone.Identifier | 0 .../widgets/menu.dart | 0 .../widgets/menu.dart:Zone.Identifier | 0 lib/firebase_options.dart:Zone.Identifier | 0 .../custom_functions.dart | 3 +- .../custom_functions.dart:Zone.Identifier | 0 .../custom_icons.dart | 2 +- .../custom_icons.dart:Zone.Identifier | 0 .../flutter_flow_animations.dart | 3 +- ...utter_flow_animations.dart:Zone.Identifier | 0 .../flutter_flow_button_tabbar.dart | 4 +- ...er_flow_button_tabbar.dart:Zone.Identifier | 0 .../flutter_flow_checkbox_group.dart | 5 +- ...r_flow_checkbox_group.dart:Zone.Identifier | 0 .../flutter_flow_drop_down.dart | 102 +- ...lutter_flow_drop_down.dart:Zone.Identifier | 0 .../flutter_flow_icon_button.dart | 4 +- ...tter_flow_icon_button.dart:Zone.Identifier | 0 .../flutter_flow_model.dart | 3 +- .../flutter_flow_model.dart:Zone.Identifier | 0 .../flutter_flow_theme.dart | 3 +- .../flutter_flow_theme.dart:Zone.Identifier | 0 .../flutter_flow_util.dart | 101 +- .../flutter_flow_util.dart:Zone.Identifier | 0 .../flutter_flow_widgets.dart | 3 +- .../flutter_flow_widgets.dart:Zone.Identifier | 0 .../form_field_controller.dart | 3 +- ...form_field_controller.dart:Zone.Identifier | 0 .../internationalization.dart | 106 +- .../internationalization.dart:Zone.Identifier | 0 .../keep_alive_wrapper.dart | 2 +- .../keep_alive_wrapper.dart:Zone.Identifier | 0 .../widgets => flutter_flow}/lat_lng.dart | 2 +- lib/flutter_flow/lat_lng.dart:Zone.Identifier | 0 .../actions => flutter_flow/nav}/nav.dart | 55 +- lib/flutter_flow/nav/nav.dart:Zone.Identifier | 0 .../nav}/serialization_util.dart | 13 +- .../serialization_util.dart:Zone.Identifier | 0 .../permissions_util.dart | 2 +- .../permissions_util.dart:Zone.Identifier | 0 .../widgets => flutter_flow}/place.dart | 2 +- lib/flutter_flow/place.dart:Zone.Identifier | 0 .../random_data_util.dart | 2 +- .../random_data_util.dart:Zone.Identifier | 0 .../request_manager.dart | 2 +- .../request_manager.dart:Zone.Identifier | 0 .../widgets => flutter_flow}/upload_data.dart | 62 +- .../upload_data.dart:Zone.Identifier | 0 .../uploaded_file.dart | 2 +- .../uploaded_file.dart:Zone.Identifier | 0 lib/index.dart | 44 +- lib/index.dart:Zone.Identifier | 0 lib/main.dart | 15 +- lib/main.dart:Zone.Identifier | 0 .../browsers/visitor_browser/widget.dart | 536 ---- .../details/schedule_visit_detail/widget.dart | 981 ------- .../details/visit_details_modal/widget.dart | 124 - .../details/visitor_details_modal/widget.dart | 282 -- lib/modals/exceptions/not_found/widget.dart | 179 -- lib/modals/forms/forgot_password/model.dart | 28 - lib/modals/forms/forgot_password/widget.dart | 313 --- .../bottom_arrow_linked_locals/widget.dart | 258 -- .../acess_history_page_model.dart} | 15 +- ...ss_history_page_model.dart:Zone.Identifier | 0 .../acess_history_page_widget.dart} | 31 +- ...s_history_page_widget.dart:Zone.Identifier | 0 .../fast_pass_page_widget.dart} | 3 +- ...fast_pass_page_widget.dart:Zone.Identifier | 0 lib/pages/home/widget.dart | 670 ----- .../home_page_model.dart} | 16 +- .../home_page_model.dart:Zone.Identifier | 0 lib/pages/home_page/home_page_widget.dart | 791 ++++++ .../home_page_widget.dart:Zone.Identifier | 0 lib/pages/index.dart | 8 - .../liberation_history_model.dart} | 10 +- ...eration_history_model.dart:Zone.Identifier | 0 .../liberation_history_widget.dart} | 31 +- ...ration_history_widget.dart:Zone.Identifier | 0 .../message_history_page_model.dart} | 18 +- ...ge_history_page_model.dart:Zone.Identifier | 0 .../message_history_page_widget.dart} | 146 +- ...e_history_page_widget.dart:Zone.Identifier | 0 .../people_on_the_property_page_model.dart} | 8 +- ...e_property_page_model.dart:Zone.Identifier | 0 .../people_on_the_property_page_widget.dart} | 18 +- ..._property_page_widget.dart:Zone.Identifier | 0 .../preferences_settings_model.dart | 244 ++ ...rences_settings_model.dart:Zone.Identifier | 0 .../preferences_settings_widget.dart} | 120 +- ...ences_settings_widget.dart:Zone.Identifier | 0 .../qr_code_page_model.dart} | 6 +- .../qr_code_page_model.dart:Zone.Identifier | 0 .../qr_code_page_widget.dart} | 29 +- .../qr_code_page_widget.dart:Zone.Identifier | 0 .../register_visitor_page_model.dart | 21 + ...er_visitor_page_model.dart:Zone.Identifier | 0 .../register_visitor_page_widget.dart | 83 + ...r_visitor_page_widget.dart:Zone.Identifier | 0 lib/pages/registers/visitor/model.dart | 59 - lib/pages/registers/visitor/widget.dart | 893 ------- .../schedule_complete_visit_page_model.dart | 213 ++ ...lete_visit_page_model.dart:Zone.Identifier | 0 .../schedule_complete_visit_page_widget.dart | 2219 ++++++++++++++++ ...ete_visit_page_widget.dart:Zone.Identifier | 0 ...chedule_provisional_visit_page_model.dart} | 10 +- ...onal_visit_page_model.dart:Zone.Identifier | 0 ...hedule_provisional_visit_page_widget.dart} | 23 +- ...nal_visit_page_widget.dart:Zone.Identifier | 0 lib/pages/schedules/visit/complete/model.dart | 109 - .../schedules/visit/complete/widget.dart | 2365 ----------------- lib/pages/settings/model.dart | 170 -- .../sign_in_page_model.dart} | 9 +- .../sign_in_page_model.dart:Zone.Identifier | 0 .../sign_in_page_widget.dart} | 15 +- .../sign_in_page_widget.dart:Zone.Identifier | 0 .../sign_up_page_model.dart} | 10 +- .../sign_up_page_model.dart:Zone.Identifier | 0 .../sign_up_page_widget.dart} | 15 +- .../sign_up_page_widget.dart:Zone.Identifier | 0 lib/pages/test_page/test_page.dart | 63 + .../test_page/test_page.dart:Zone.Identifier | 0 .../visit_history_page_model.dart} | 15 +- ...it_history_page_model.dart:Zone.Identifier | 0 .../visit_history_page_widget.dart} | 52 +- ...t_history_page_widget.dart:Zone.Identifier | 0 .../welcome_page_model.dart} | 9 +- .../welcome_page_model.dart:Zone.Identifier | 0 .../welcome_page_widget.dart} | 15 +- .../welcome_page_widget.dart:Zone.Identifier | 0 .../components/atoms/atom_terms_of_use.dart | 40 + .../atom_terms_of_use.dart:Zone.Identifier | 0 lib/shared/enums/enum_throw_exception.dart | 5 + .../enum_throw_exception.dart:Zone.Identifier | 0 lib/shared/utils/dialog_util.dart | 59 + .../utils/dialog_util.dart:Zone.Identifier | 0 lib/shared/utils/log_util.dart | 15 + .../utils/log_util.dart:Zone.Identifier | 0 lib/shared/utils/validator_util.dart | 17 + .../utils/validator_util.dart:Zone.Identifier | 0 pubspec.lock | 16 + pubspec.lock:Zone.Identifier | 0 pubspec.yaml | 2 +- pubspec.yaml:Zone.Identifier | 0 test/widget_test.dart | 28 +- test/widget_test.dart:Zone.Identifier | 0 web/favicon.png:Zone.Identifier | 0 web/icons/Icon-192.png:Zone.Identifier | 0 web/icons/Icon-512.png:Zone.Identifier | 0 .../app_launcher_icon.svg:Zone.Identifier | 0 web/index.html:Zone.Identifier | 0 448 files changed, 10214 insertions(+), 11199 deletions(-) rename lib/commons/components/atoms/index.dart => .tool-versions:Zone.Identifier (100%) rename lib/commons/components/atoms/local_header/index.dart => README.md:Zone.Identifier (100%) rename lib/commons/components/atoms/menu_button_item/index.dart => analysis_options.yaml:Zone.Identifier (100%) rename lib/commons/components/atoms/menu_card_item/index.dart => android/.gitignore:Zone.Identifier (100%) rename lib/commons/components/index.dart => android/app/build.gradle:Zone.Identifier (100%) rename lib/commons/components/molecules/card/index.dart => android/app/google-services.json:Zone.Identifier (100%) rename lib/commons/components/molecules/header/index.dart => android/app/src/debug/AndroidManifest.xml:Zone.Identifier (100%) rename lib/commons/components/molecules/index.dart => android/app/src/main/AndroidManifest.xml:Zone.Identifier (100%) rename lib/commons/components/molecules/menu_item/index.dart => android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier (100%) rename lib/commons/components/molecules/menu_list_view/index.dart => android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/molecules/menu_staggered_view/index.dart => android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier (100%) rename lib/commons/components/molecules/message_well/index.dart => android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/molecules/well/index.dart => android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/organisms/index.dart => android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier (100%) rename lib/commons/components/organisms/menu/index.dart => android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/templates/browser/index.dart => android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier (100%) rename lib/commons/components/templates/consult/index.dart => android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/templates/consult/model.dart => android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier (100%) rename lib/commons/components/templates/consult/widget.dart => android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/templates/detail/index.dart => android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier (100%) rename lib/commons/components/templates/exception/index.dart => android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier (100%) rename lib/commons/components/templates/filter/index.dart => android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier (100%) rename lib/commons/components/templates/forms/index.dart => android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier (100%) rename lib/commons/components/templates/index.dart => android/app/src/main/res/values-night/styles.xml:Zone.Identifier (100%) rename lib/commons/components/templates/notification/index.dart => android/app/src/main/res/values-v31/styles.xml:Zone.Identifier (100%) rename lib/commons/components/templates/register/index.dart => android/app/src/main/res/values/strings.xml:Zone.Identifier (100%) rename lib/commons/components/templates/register/mode.dart => android/app/src/main/res/values/styles.xml:Zone.Identifier (100%) rename lib/commons/components/templates/register/widget.dart => android/app/src/profile/AndroidManifest.xml:Zone.Identifier (100%) rename lib/commons/components/templates/schedule/index.dart => android/build.gradle:Zone.Identifier (100%) rename lib/commons/components/templates/schedule/model.dart => android/gradle.properties:Zone.Identifier (100%) rename lib/commons/components/templates/schedule/widget.dart => android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier (100%) rename lib/commons/components/templates/setting/index.dart => android/settings.gradle:Zone.Identifier (100%) rename lib/commons/components/templates/setting/model.dart => assets/audios/favicon.png:Zone.Identifier (100%) rename lib/commons/components/templates/setting/widget.dart => assets/fonts/Nunito-Medium.ttf:Zone.Identifier (100%) rename lib/commons/components/templates/welcome/index.dart => assets/fonts/Nunito-Regular.ttf:Zone.Identifier (100%) rename lib/commons/components/templates/welcome/model.dart => assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier (100%) rename lib/commons/components/templates/welcome/widget.dart => assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier (100%) rename lib/commons/schema/enums/index.dart => assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier (100%) rename lib/commons/schema/index.dart => assets/fonts/favicon.png:Zone.Identifier (100%) rename lib/commons/schema/util/index.dart => assets/fonts/icons.ttf:Zone.Identifier (100%) rename lib/commons/widgets/a11y/index.dart => assets/fonts/menu.ttf:Zone.Identifier (100%) rename lib/commons/widgets/control/index.dart => assets/images/adaptive_background_icon.svg:Zone.Identifier (100%) rename lib/commons/widgets/info/index.dart => assets/images/adaptive_foreground_icon.svg:Zone.Identifier (100%) rename lib/commons/widgets/io/index.dart => assets/images/app_launcher_icon.svg:Zone.Identifier (100%) rename lib/commons/widgets/io/textfield/index.dart => assets/images/dark/login.svg:Zone.Identifier (100%) create mode 100644 assets/images/dark/register.svg rename lib/commons/widgets/layout/index.dart => assets/images/dark/register.svg:Zone.Identifier (100%) rename lib/commons/widgets/nav/index.dart => assets/images/dark/welcome.svg:Zone.Identifier (100%) rename lib/commons/widgets/scroll/index.dart => assets/images/error_image.svg:Zone.Identifier (100%) rename lib/commons/widgets/style/index.dart => assets/images/favicon.png:Zone.Identifier (100%) rename lib/commons/widgets/view/index.dart => assets/images/light/login.svg:Zone.Identifier (100%) create mode 100644 assets/images/light/register.svg rename lib/modals/browsers/index.dart => assets/images/light/register.svg:Zone.Identifier (100%) rename lib/modals/browsers/visitor_browser/index.dart => assets/images/light/welcome.svg:Zone.Identifier (100%) rename lib/modals/details/index.dart => assets/images/logo.svg:Zone.Identifier (100%) delete mode 100644 assets/images/welcome.svg rename lib/modals/details/liberation_history_item_details/index.dart => assets/lottie_animations/favicon.png:Zone.Identifier (100%) rename lib/modals/details/schedule_visit_detail/index.dart => assets/pdfs/favicon.png:Zone.Identifier (100%) rename lib/modals/details/view_visit_detail/index.dart => assets/rive_animations/favicon.png:Zone.Identifier (100%) rename lib/modals/details/visit_details_modal/index.dart => assets/videos/favicon.png:Zone.Identifier (100%) rename lib/modals/details/visitor_details_modal/index.dart => devtools_options.yaml:Zone.Identifier (100%) rename lib/modals/exceptions/error/index.dart => firebase.json:Zone.Identifier (100%) rename lib/modals/exceptions/index.dart => ios/.gitignore:Zone.Identifier (100%) rename lib/modals/exceptions/info/index.dart => ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier (100%) rename lib/modals/exceptions/not_found/index.dart => ios/Flutter/Debug.xcconfig:Zone.Identifier (100%) rename lib/modals/exceptions/warning/index.dart => ios/Flutter/Release.xcconfig:Zone.Identifier (100%) rename lib/modals/filters/access_filter/index.dart => ios/ImageNotification/Info.plist:Zone.Identifier (100%) rename lib/modals/filters/options/index.dart => ios/ImageNotification/NotificationService.swift:Zone.Identifier (100%) rename lib/modals/filters/selections/index.dart => ios/Podfile.lock:Zone.Identifier (100%) rename lib/modals/forms/change_password/index.dart => ios/Podfile:Zone.Identifier (100%) rename lib/modals/forms/forgot_password/index.dart => ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier (100%) rename lib/modals/forms/index.dart => ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier (100%) rename lib/modals/forms/qr_code/index.dart => ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier (100%) rename lib/modals/index.dart => ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier (100%) rename lib/modals/notifications/access_notification/index.dart => ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier (100%) rename lib/modals/notifications/index.dart => ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier (100%) rename lib/modals/notifications/message_notificaion/index.dart => ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier (100%) rename lib/modals/notifications/visit_request/index.dart => ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier (100%) rename lib/modals/selection/bottom_arrow_linked_locals/index.dart => ios/Runner/AppDelegate.swift:Zone.Identifier (100%) rename lib/modals/selection/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier (100%) rename lib/modals/selection/top_arrow_linked_locals/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier (100%) rename lib/modals/selection/up_arrow_linked_locals/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier (100%) rename lib/pages/consults/access/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier (100%) rename lib/pages/consults/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier (100%) rename lib/pages/consults/liberation/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier (100%) rename lib/pages/consults/message/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier (100%) rename lib/pages/consults/poeple/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier (100%) rename lib/pages/consults/qrcode/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier (100%) rename lib/pages/consults/visit/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier (100%) rename lib/pages/home/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier (100%) rename lib/pages/onboarding/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier (100%) rename lib/pages/registers/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier (100%) rename lib/pages/registers/visitor/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier (100%) rename lib/pages/schedules/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier (100%) rename lib/pages/schedules/visit/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier (100%) rename lib/pages/settings/index.dart => ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier (100%) create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier create mode 100644 ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier create mode 100644 ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier create mode 100644 ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier create mode 100644 ios/Runner/GoogleService-Info.plist:Zone.Identifier create mode 100644 ios/Runner/Info.plist:Zone.Identifier create mode 100644 ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier create mode 100644 ios/Runner/Runner-Bridging-Header.h:Zone.Identifier create mode 100644 ios/Runner/Runner.entitlements:Zone.Identifier create mode 100644 ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier create mode 100644 ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier create mode 100644 lib/actions/actions.dart create mode 100644 lib/actions/actions.dart:Zone.Identifier create mode 100644 lib/app_state.dart:Zone.Identifier rename lib/{commons/actions => backend/api_requests}/api_calls.dart (99%) create mode 100644 lib/backend/api_requests/api_calls.dart:Zone.Identifier rename lib/{commons/actions => backend/api_requests}/api_manager.dart (99%) create mode 100644 lib/backend/api_requests/api_manager.dart:Zone.Identifier rename lib/{commons/actions => backend/api_requests}/get_streamed_response.dart (77%) create mode 100644 lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier rename lib/{commons/actions => backend/push_notification}/pushNotificationService.dart (94%) create mode 100644 lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier rename lib/{commons/actions => backend/push_notification}/tapNotifcationActivity.dart (95%) create mode 100644 lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier rename lib/{commons => backend}/schema/enums/enums.dart (99%) create mode 100644 lib/backend/schema/enums/enums.dart:Zone.Identifier rename lib/{commons => backend}/schema/structs/device_struct.dart (96%) create mode 100644 lib/backend/schema/structs/device_struct.dart:Zone.Identifier create mode 100644 lib/backend/schema/structs/index.dart create mode 100644 lib/backend/schema/structs/index.dart:Zone.Identifier rename lib/{commons => backend}/schema/util/schema_util.dart (91%) create mode 100644 lib/backend/schema/util/schema_util.dart:Zone.Identifier delete mode 100644 lib/commons/actions/actions.dart delete mode 100644 lib/commons/components/atoms/menu_card_item/widget.dart delete mode 100644 lib/commons/components/molecules/menu_item/widget.dart delete mode 100644 lib/commons/components/molecules/menu_staggered_view/widget.dart delete mode 100644 lib/commons/components/organisms/menu/widget.dart delete mode 100644 lib/commons/components/templates/exception/widget.dart delete mode 100644 lib/commons/schema/structs/index.dart rename lib/{commons/components/atoms/menu_button_item/widget.dart => components/atomic_components/menu_button_item/menu_button_item_widget.dart} (95%) create mode 100644 lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier create mode 100644 lib/components/atomic_components/menu_card_item/menu_card_item.dart create mode 100644 lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier rename lib/{shared/components/atoms => components/atomic_components/shared_components_atoms}/atom_image_svg_theme.dart (62%) create mode 100644 lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier rename lib/{commons/widgets/io/textfield/model.dart => components/atomic_components/text_field_component/text_field_component_model.dart} (81%) create mode 100644 lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier rename lib/{commons/widgets/io/textfield/widget.dart => components/atomic_components/text_field_component/text_field_component_widget.dart} (95%) create mode 100644 lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier create mode 100644 lib/components/molecular_components/menu_item/menu_item.dart create mode 100644 lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier rename lib/{modals/filters/access_filter/model.dart => components/molecular_components/message_opt_modal/opt_modal_model.dart} (85%) create mode 100644 lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier rename lib/{modals/filters/access_filter/widget.dart => components/molecular_components/message_opt_modal/opt_modal_widget.dart} (96%) create mode 100644 lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier rename lib/{modals/filters/options/model.dart => components/molecular_components/opt_modal/opt_modal_model.dart} (85%) create mode 100644 lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier rename lib/{modals/filters/options/widget.dart => components/molecular_components/opt_modal/opt_modal_widget.dart} (97%) create mode 100644 lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier rename lib/{modals/filters/selections/model.dart => components/molecular_components/option_selection_modal/option_selection_modal_model.dart} (55%) create mode 100644 lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier rename lib/{modals/filters/selections/widget.dart => components/molecular_components/option_selection_modal/option_selection_modal_widget.dart} (96%) create mode 100644 lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier rename lib/{commons/components/templates/exception/model.dart => components/molecular_components/throw_exception/throw_exception_model.dart} (64%) create mode 100644 lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier create mode 100644 lib/components/molecular_components/throw_exception/throw_exception_widget.dart create mode 100644 lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier rename lib/{modals/exceptions/not_found/model.dart => components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart} (55%) create mode 100644 lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier create mode 100644 lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart create mode 100644 lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier rename lib/{modals/selection/top_arrow_linked_locals/model.dart => components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart} (55%) create mode 100644 lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier rename lib/{modals/selection/top_arrow_linked_locals/widget.dart => components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart} (81%) create mode 100644 lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier rename lib/{modals/selection/bottom_arrow_linked_locals/model.dart => components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart} (54%) create mode 100644 lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier create mode 100644 lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart create mode 100644 lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier rename lib/{commons/components/atoms/local_header/model.dart => components/organism_components/local_profile_component/local_profile_component_model.dart} (62%) create mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier rename lib/{commons/components/atoms/local_header/widget.dart => components/organism_components/local_profile_component/local_profile_component_widget.dart} (92%) create mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier rename lib/{commons/components/organisms/menu/model.dart => components/organism_components/menu_component/menu_component_model.dart} (91%) create mode 100644 lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier create mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart create mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier rename lib/{commons/components/molecules/menu_list_view/model.dart => components/organism_components/menu_list_view_component/menu_list_view_component_model.dart} (63%) create mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier rename lib/{commons/components/molecules/menu_list_view/widget.dart => components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart} (63%) create mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier rename lib/{commons/components/molecules/menu_staggered_view/model.dart => components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart} (57%) create mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier create mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart create mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier rename lib/{commons/components/molecules/message_well/model.dart => components/organism_components/message_well_component/message_well_component_model.dart} (81%) create mode 100644 lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier rename lib/{commons/components/molecules/message_well/widget.dart => components/organism_components/message_well_component/message_well_component_widget.dart} (98%) create mode 100644 lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier rename lib/{modals/details/schedule_visit_detail/model.dart => components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart} (60%) create mode 100644 lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier create mode 100644 lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart create mode 100644 lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier rename lib/{modals/selection/up_arrow_linked_locals/model.dart => components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart} (54%) create mode 100644 lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier rename lib/{modals/selection/up_arrow_linked_locals/widget.dart => components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart} (96%) create mode 100644 lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier rename lib/{modals/notifications/access_notification/model.dart => components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart} (92%) create mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier rename lib/{modals/notifications/access_notification/widget.dart => components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart} (98%) create mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier rename lib/{commons/components/molecules/card/model.dart => components/templates_components/card_item_template_component/card_item_template_component_model.dart} (62%) create mode 100644 lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier rename lib/{commons/components/molecules/card/widget.dart => components/templates_components/card_item_template_component/card_item_template_component_widget.dart} (98%) create mode 100644 lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier rename lib/{modals/forms/change_password/model.dart => components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart} (95%) create mode 100644 lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier rename lib/{modals/forms/change_password/widget.dart => components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart} (98%) create mode 100644 lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier create mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart create mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier create mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart create mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier rename lib/{modals/details/liberation_history_item_details/model.dart => components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart} (85%) create mode 100644 lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier rename lib/{modals/details/liberation_history_item_details/widget.dart => components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart} (97%) create mode 100644 lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier rename lib/{modals/notifications/message_notificaion/model.dart => components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart} (86%) create mode 100644 lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier rename lib/{modals/notifications/message_notificaion/widget.dart => components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart} (96%) create mode 100644 lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier rename lib/{modals/forms/qr_code/model.dart => components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart} (92%) create mode 100644 lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier rename lib/{modals/forms/qr_code/widget.dart => components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart} (97%) create mode 100644 lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier create mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart create mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier rename lib/{pages/registers/visitor/component.dart => components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart} (56%) create mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier create mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart create mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier rename lib/{pages/onboarding/signin/component.dart => components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart} (82%) create mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier create mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart create mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier rename lib/{pages/onboarding/signup/component.dart => components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart} (89%) create mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier rename lib/{modals/details/view_visit_detail/model.dart => components/templates_components/view_visit_detail/view_visit_detail_model.dart} (92%) create mode 100644 lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier rename lib/{modals/details/view_visit_detail/widget.dart => components/templates_components/view_visit_detail/view_visit_detail_widget.dart} (95%) create mode 100644 lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier rename lib/{modals/details/visit_details_modal/model.dart => components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart} (67%) create mode 100644 lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier create mode 100644 lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart create mode 100644 lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier rename lib/{modals/notifications/visit_request/model.dart => components/templates_components/visit_request_template_component/visit_request_template_component_model.dart} (90%) create mode 100644 lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier rename lib/{modals/notifications/visit_request/widget.dart => components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart} (99%) create mode 100644 lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier rename lib/{modals/details/visitor_details_modal/model.dart => components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart} (73%) create mode 100644 lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier create mode 100644 lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart create mode 100644 lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier rename lib/{modals/browsers/visitor_browser/model.dart => components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart} (85%) create mode 100644 lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier create mode 100644 lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart create mode 100644 lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier create mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart create mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier rename lib/{pages/onboarding/welcome/component.dart => components/templates_components/welcome_template_component/welcome_template_component_widget.dart} (97%) create mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier rename lib/{commons => custom_code}/actions/convert_image_file_to_base64.dart (55%) create mode 100644 lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier rename lib/{commons => custom_code}/actions/convert_to_upload_file.dart (73%) create mode 100644 lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier rename lib/{commons => custom_code}/actions/get_dev_u_u_i_d.dart (91%) create mode 100644 lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier rename lib/{commons => custom_code}/actions/index.dart (60%) create mode 100644 lib/custom_code/actions/index.dart:Zone.Identifier rename lib/{commons => custom_code}/widgets/image_cropper.dart (97%) create mode 100644 lib/custom_code/widgets/image_cropper.dart:Zone.Identifier rename lib/{commons => custom_code}/widgets/index.dart (100%) create mode 100644 lib/custom_code/widgets/index.dart:Zone.Identifier rename lib/{commons => custom_code}/widgets/menu.dart (100%) create mode 100644 lib/custom_code/widgets/menu.dart:Zone.Identifier create mode 100644 lib/firebase_options.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/custom_functions.dart (97%) create mode 100644 lib/flutter_flow/custom_functions.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/custom_icons.dart (99%) create mode 100644 lib/flutter_flow/custom_icons.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_animations.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_button_tabbar.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_checkbox_group.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_drop_down.dart (83%) create mode 100644 lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_icon_button.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_model.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_theme.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_util.dart (84%) create mode 100644 lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/flutter_flow_widgets.dart (99%) create mode 100644 lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/form_field_controller.dart (99%) create mode 100644 lib/flutter_flow/form_field_controller.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/internationalization.dart (94%) create mode 100644 lib/flutter_flow/internationalization.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/keep_alive_wrapper.dart (99%) create mode 100644 lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/lat_lng.dart (99%) create mode 100644 lib/flutter_flow/lat_lng.dart:Zone.Identifier rename lib/{commons/actions => flutter_flow/nav}/nav.dart (89%) create mode 100644 lib/flutter_flow/nav/nav.dart:Zone.Identifier rename lib/{commons/actions => flutter_flow/nav}/serialization_util.dart (96%) create mode 100644 lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/permissions_util.dart (94%) create mode 100644 lib/flutter_flow/permissions_util.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/place.dart (99%) create mode 100644 lib/flutter_flow/place.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/random_data_util.dart (99%) create mode 100644 lib/flutter_flow/random_data_util.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/request_manager.dart (98%) create mode 100644 lib/flutter_flow/request_manager.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/upload_data.dart (87%) create mode 100644 lib/flutter_flow/upload_data.dart:Zone.Identifier rename lib/{commons/widgets => flutter_flow}/uploaded_file.dart (99%) create mode 100644 lib/flutter_flow/uploaded_file.dart:Zone.Identifier create mode 100644 lib/index.dart:Zone.Identifier create mode 100644 lib/main.dart:Zone.Identifier delete mode 100644 lib/modals/browsers/visitor_browser/widget.dart delete mode 100644 lib/modals/details/schedule_visit_detail/widget.dart delete mode 100644 lib/modals/details/visit_details_modal/widget.dart delete mode 100644 lib/modals/details/visitor_details_modal/widget.dart delete mode 100644 lib/modals/exceptions/not_found/widget.dart delete mode 100644 lib/modals/forms/forgot_password/model.dart delete mode 100644 lib/modals/forms/forgot_password/widget.dart delete mode 100644 lib/modals/selection/bottom_arrow_linked_locals/widget.dart rename lib/pages/{consults/access/model.dart => acess_history_page/acess_history_page_model.dart} (74%) create mode 100644 lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier rename lib/pages/{consults/access/widget.dart => acess_history_page/acess_history_page_widget.dart} (95%) create mode 100644 lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier rename lib/pages/{schedules/visit/fastpass/widget.dart => fast_pass_page/fast_pass_page_widget.dart} (98%) create mode 100644 lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/home/widget.dart rename lib/pages/{home/model.dart => home_page/home_page_model.dart} (74%) create mode 100644 lib/pages/home_page/home_page_model.dart:Zone.Identifier create mode 100644 lib/pages/home_page/home_page_widget.dart create mode 100644 lib/pages/home_page/home_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/index.dart rename lib/pages/{consults/liberation/model.dart => liberation_history/liberation_history_model.dart} (83%) create mode 100644 lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier rename lib/pages/{consults/liberation/widget.dart => liberation_history/liberation_history_widget.dart} (93%) create mode 100644 lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier rename lib/pages/{consults/message/model.dart => message_history_page/message_history_page_model.dart} (77%) create mode 100644 lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier rename lib/pages/{consults/message/widget.dart => message_history_page/message_history_page_widget.dart} (68%) create mode 100644 lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier rename lib/pages/{consults/poeple/model.dart => people_on_the_property_page/people_on_the_property_page_model.dart} (68%) create mode 100644 lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier rename lib/pages/{consults/poeple/widget.dart => people_on_the_property_page/people_on_the_property_page_widget.dart} (93%) create mode 100644 lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier create mode 100644 lib/pages/preferences_settings_page/preferences_settings_model.dart create mode 100644 lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier rename lib/pages/{settings/widget.dart => preferences_settings_page/preferences_settings_widget.dart} (65%) create mode 100644 lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier rename lib/pages/{consults/qrcode/model.dart => qr_code_page/qr_code_page_model.dart} (81%) create mode 100644 lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier rename lib/pages/{consults/qrcode/widget.dart => qr_code_page/qr_code_page_widget.dart} (95%) create mode 100644 lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier create mode 100644 lib/pages/register_visitor_page/register_visitor_page_model.dart create mode 100644 lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier create mode 100644 lib/pages/register_visitor_page/register_visitor_page_widget.dart create mode 100644 lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/registers/visitor/model.dart delete mode 100644 lib/pages/registers/visitor/widget.dart create mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart create mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier create mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart create mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier rename lib/pages/{schedules/visit/provisional/model.dart => schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart} (90%) create mode 100644 lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier rename lib/pages/{schedules/visit/provisional/widget.dart => schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart} (98%) create mode 100644 lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/schedules/visit/complete/model.dart delete mode 100644 lib/pages/schedules/visit/complete/widget.dart delete mode 100644 lib/pages/settings/model.dart rename lib/pages/{onboarding/signin/model.dart => sign_in_page/sign_in_page_model.dart} (73%) create mode 100644 lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier rename lib/pages/{onboarding/signin/widget.dart => sign_in_page/sign_in_page_widget.dart} (81%) create mode 100644 lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier rename lib/pages/{onboarding/signup/model.dart => sign_up_page/sign_up_page_model.dart} (73%) create mode 100644 lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier rename lib/pages/{onboarding/signup/widget.dart => sign_up_page/sign_up_page_widget.dart} (81%) create mode 100644 lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier create mode 100644 lib/pages/test_page/test_page.dart create mode 100644 lib/pages/test_page/test_page.dart:Zone.Identifier rename lib/pages/{consults/visit/model.dart => visit_history_page/visit_history_page_model.dart} (91%) create mode 100644 lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier rename lib/pages/{consults/visit/widget.dart => visit_history_page/visit_history_page_widget.dart} (96%) create mode 100644 lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier rename lib/pages/{onboarding/welcome/model.dart => welcome_page/welcome_page_model.dart} (75%) create mode 100644 lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier rename lib/pages/{onboarding/welcome/widget.dart => welcome_page/welcome_page_widget.dart} (86%) create mode 100644 lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier create mode 100644 lib/shared/components/atoms/atom_terms_of_use.dart create mode 100644 lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier create mode 100644 lib/shared/enums/enum_throw_exception.dart create mode 100644 lib/shared/enums/enum_throw_exception.dart:Zone.Identifier create mode 100644 lib/shared/utils/dialog_util.dart create mode 100644 lib/shared/utils/dialog_util.dart:Zone.Identifier create mode 100644 lib/shared/utils/log_util.dart create mode 100644 lib/shared/utils/log_util.dart:Zone.Identifier create mode 100644 lib/shared/utils/validator_util.dart create mode 100644 lib/shared/utils/validator_util.dart:Zone.Identifier create mode 100644 pubspec.lock:Zone.Identifier create mode 100644 pubspec.yaml:Zone.Identifier create mode 100644 test/widget_test.dart:Zone.Identifier create mode 100644 web/favicon.png:Zone.Identifier create mode 100644 web/icons/Icon-192.png:Zone.Identifier create mode 100644 web/icons/Icon-512.png:Zone.Identifier create mode 100644 web/icons/app_launcher_icon.svg:Zone.Identifier create mode 100644 web/index.html:Zone.Identifier diff --git a/lib/commons/components/atoms/index.dart b/.tool-versions:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/index.dart rename to .tool-versions:Zone.Identifier diff --git a/lib/commons/components/atoms/local_header/index.dart b/README.md:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/local_header/index.dart rename to README.md:Zone.Identifier diff --git a/lib/commons/components/atoms/menu_button_item/index.dart b/analysis_options.yaml:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/menu_button_item/index.dart rename to analysis_options.yaml:Zone.Identifier diff --git a/lib/commons/components/atoms/menu_card_item/index.dart b/android/.gitignore:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/menu_card_item/index.dart rename to android/.gitignore:Zone.Identifier diff --git a/lib/commons/components/index.dart b/android/app/build.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/index.dart rename to android/app/build.gradle:Zone.Identifier diff --git a/lib/commons/components/molecules/card/index.dart b/android/app/google-services.json:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/card/index.dart rename to android/app/google-services.json:Zone.Identifier diff --git a/lib/commons/components/molecules/header/index.dart b/android/app/src/debug/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/header/index.dart rename to android/app/src/debug/AndroidManifest.xml:Zone.Identifier diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1994e1c8..87d8dd6f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,7 +10,7 @@ diff --git a/lib/commons/components/molecules/index.dart b/android/app/src/main/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/index.dart rename to android/app/src/main/AndroidManifest.xml:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_item/index.dart b/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_item/index.dart rename to android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_list_view/index.dart b/android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_list_view/index.dart rename to android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_staggered_view/index.dart b/android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_staggered_view/index.dart rename to android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier diff --git a/lib/commons/components/molecules/message_well/index.dart b/android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/message_well/index.dart rename to android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/molecules/well/index.dart b/android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/well/index.dart rename to android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/organisms/index.dart b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/organisms/index.dart rename to android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/organisms/menu/index.dart b/android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/organisms/menu/index.dart rename to android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/browser/index.dart b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/browser/index.dart rename to android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/index.dart b/android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/index.dart rename to android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/model.dart b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/model.dart rename to android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/widget.dart b/android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/widget.dart rename to android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/detail/index.dart b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/detail/index.dart rename to android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/exception/index.dart b/android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/exception/index.dart rename to android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/filter/index.dart b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/filter/index.dart rename to android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/forms/index.dart b/android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/forms/index.dart rename to android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/index.dart b/android/app/src/main/res/values-night/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/index.dart rename to android/app/src/main/res/values-night/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/notification/index.dart b/android/app/src/main/res/values-v31/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/notification/index.dart rename to android/app/src/main/res/values-v31/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/index.dart b/android/app/src/main/res/values/strings.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/index.dart rename to android/app/src/main/res/values/strings.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/mode.dart b/android/app/src/main/res/values/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/mode.dart rename to android/app/src/main/res/values/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/widget.dart b/android/app/src/profile/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/widget.dart rename to android/app/src/profile/AndroidManifest.xml:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/index.dart b/android/build.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/index.dart rename to android/build.gradle:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/model.dart b/android/gradle.properties:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/model.dart rename to android/gradle.properties:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/widget.dart b/android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/widget.dart rename to android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier diff --git a/lib/commons/components/templates/setting/index.dart b/android/settings.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/index.dart rename to android/settings.gradle:Zone.Identifier diff --git a/lib/commons/components/templates/setting/model.dart b/assets/audios/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/model.dart rename to assets/audios/favicon.png:Zone.Identifier diff --git a/lib/commons/components/templates/setting/widget.dart b/assets/fonts/Nunito-Medium.ttf:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/widget.dart rename to assets/fonts/Nunito-Medium.ttf:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/index.dart b/assets/fonts/Nunito-Regular.ttf:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/index.dart rename to assets/fonts/Nunito-Regular.ttf:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/model.dart b/assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/model.dart rename to assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/widget.dart b/assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/widget.dart rename to assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier diff --git a/lib/commons/schema/enums/index.dart b/assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier similarity index 100% rename from lib/commons/schema/enums/index.dart rename to assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier diff --git a/lib/commons/schema/index.dart b/assets/fonts/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/schema/index.dart rename to assets/fonts/favicon.png:Zone.Identifier diff --git a/lib/commons/schema/util/index.dart b/assets/fonts/icons.ttf:Zone.Identifier similarity index 100% rename from lib/commons/schema/util/index.dart rename to assets/fonts/icons.ttf:Zone.Identifier diff --git a/lib/commons/widgets/a11y/index.dart b/assets/fonts/menu.ttf:Zone.Identifier similarity index 100% rename from lib/commons/widgets/a11y/index.dart rename to assets/fonts/menu.ttf:Zone.Identifier diff --git a/lib/commons/widgets/control/index.dart b/assets/images/adaptive_background_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/control/index.dart rename to assets/images/adaptive_background_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/info/index.dart b/assets/images/adaptive_foreground_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/info/index.dart rename to assets/images/adaptive_foreground_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/io/index.dart b/assets/images/app_launcher_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/io/index.dart rename to assets/images/app_launcher_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/io/textfield/index.dart b/assets/images/dark/login.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/io/textfield/index.dart rename to assets/images/dark/login.svg:Zone.Identifier diff --git a/assets/images/dark/register.svg b/assets/images/dark/register.svg new file mode 100644 index 00000000..5e7071f7 --- /dev/null +++ b/assets/images/dark/register.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/commons/widgets/layout/index.dart b/assets/images/dark/register.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/layout/index.dart rename to assets/images/dark/register.svg:Zone.Identifier diff --git a/lib/commons/widgets/nav/index.dart b/assets/images/dark/welcome.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/nav/index.dart rename to assets/images/dark/welcome.svg:Zone.Identifier diff --git a/lib/commons/widgets/scroll/index.dart b/assets/images/error_image.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/scroll/index.dart rename to assets/images/error_image.svg:Zone.Identifier diff --git a/lib/commons/widgets/style/index.dart b/assets/images/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/widgets/style/index.dart rename to assets/images/favicon.png:Zone.Identifier diff --git a/lib/commons/widgets/view/index.dart b/assets/images/light/login.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/view/index.dart rename to assets/images/light/login.svg:Zone.Identifier diff --git a/assets/images/light/register.svg b/assets/images/light/register.svg new file mode 100644 index 00000000..2fecef14 --- /dev/null +++ b/assets/images/light/register.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/modals/browsers/index.dart b/assets/images/light/register.svg:Zone.Identifier similarity index 100% rename from lib/modals/browsers/index.dart rename to assets/images/light/register.svg:Zone.Identifier diff --git a/lib/modals/browsers/visitor_browser/index.dart b/assets/images/light/welcome.svg:Zone.Identifier similarity index 100% rename from lib/modals/browsers/visitor_browser/index.dart rename to assets/images/light/welcome.svg:Zone.Identifier diff --git a/lib/modals/details/index.dart b/assets/images/logo.svg:Zone.Identifier similarity index 100% rename from lib/modals/details/index.dart rename to assets/images/logo.svg:Zone.Identifier diff --git a/assets/images/welcome.svg b/assets/images/welcome.svg deleted file mode 100644 index 8983fac0..00000000 --- a/assets/images/welcome.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/modals/details/liberation_history_item_details/index.dart b/assets/lottie_animations/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/liberation_history_item_details/index.dart rename to assets/lottie_animations/favicon.png:Zone.Identifier diff --git a/lib/modals/details/schedule_visit_detail/index.dart b/assets/pdfs/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/schedule_visit_detail/index.dart rename to assets/pdfs/favicon.png:Zone.Identifier diff --git a/lib/modals/details/view_visit_detail/index.dart b/assets/rive_animations/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/view_visit_detail/index.dart rename to assets/rive_animations/favicon.png:Zone.Identifier diff --git a/lib/modals/details/visit_details_modal/index.dart b/assets/videos/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/visit_details_modal/index.dart rename to assets/videos/favicon.png:Zone.Identifier diff --git a/lib/modals/details/visitor_details_modal/index.dart b/devtools_options.yaml:Zone.Identifier similarity index 100% rename from lib/modals/details/visitor_details_modal/index.dart rename to devtools_options.yaml:Zone.Identifier diff --git a/lib/modals/exceptions/error/index.dart b/firebase.json:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/error/index.dart rename to firebase.json:Zone.Identifier diff --git a/lib/modals/exceptions/index.dart b/ios/.gitignore:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/index.dart rename to ios/.gitignore:Zone.Identifier diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index ff0dcf11..748aee74 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 14.0 + 14.0.0 diff --git a/lib/modals/exceptions/info/index.dart b/ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/info/index.dart rename to ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier diff --git a/lib/modals/exceptions/not_found/index.dart b/ios/Flutter/Debug.xcconfig:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/not_found/index.dart rename to ios/Flutter/Debug.xcconfig:Zone.Identifier diff --git a/lib/modals/exceptions/warning/index.dart b/ios/Flutter/Release.xcconfig:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/warning/index.dart rename to ios/Flutter/Release.xcconfig:Zone.Identifier diff --git a/lib/modals/filters/access_filter/index.dart b/ios/ImageNotification/Info.plist:Zone.Identifier similarity index 100% rename from lib/modals/filters/access_filter/index.dart rename to ios/ImageNotification/Info.plist:Zone.Identifier diff --git a/lib/modals/filters/options/index.dart b/ios/ImageNotification/NotificationService.swift:Zone.Identifier similarity index 100% rename from lib/modals/filters/options/index.dart rename to ios/ImageNotification/NotificationService.swift:Zone.Identifier diff --git a/ios/Podfile b/ios/Podfile index a43aebd4..8f4bfd94 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '14.0' +platform :ios, '14.0.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 20609413..0aa4fbd2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -42,6 +42,9 @@ PODS: - FirebaseAnalytics (~> 10.27.0) - Firebase/CoreOnly (10.27.0): - FirebaseCore (= 10.27.0) + - Firebase/Crashlytics (10.27.0): + - Firebase/CoreOnly + - FirebaseCrashlytics (~> 10.27.0) - Firebase/Messaging (10.27.0): - Firebase/CoreOnly - FirebaseMessaging (~> 10.27.0) @@ -52,6 +55,10 @@ PODS: - firebase_core (3.1.0): - Firebase/CoreOnly (= 10.27.0) - Flutter + - firebase_crashlytics (4.0.1): + - Firebase/Crashlytics (= 10.27.0) + - firebase_core + - Flutter - firebase_messaging (15.0.1): - Firebase/Messaging (= 10.27.0) - firebase_core @@ -78,8 +85,19 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreExtension (10.29.0): + - FirebaseCore (~> 10.0) - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseCrashlytics (10.27.0): + - FirebaseCore (~> 10.5) + - FirebaseInstallations (~> 10.0) + - FirebaseRemoteConfigInterop (~> 10.23) + - FirebaseSessions (~> 10.5) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (~> 2.1) - FirebaseInstallations (10.28.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) @@ -94,6 +112,16 @@ PODS: - GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseRemoteConfigInterop (10.29.0) + - FirebaseSessions (10.29.0): + - FirebaseCore (~> 10.5) + - FirebaseCoreExtension (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.13) + - GoogleUtilities/UserDefaults (~> 7.13) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesSwift (~> 2.1) - Flutter (1.0.0) - flutter_inappwebview_ios (0.0.1): - Flutter @@ -174,6 +202,8 @@ PODS: - permission_handler_apple (9.3.0): - Flutter - PromisesObjC (2.4.0) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) - SDWebImage (5.19.2): - SDWebImage/Core (= 5.19.2) - SDWebImage/Core (5.19.2) @@ -199,6 +229,7 @@ DEPENDENCIES: - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) @@ -222,15 +253,20 @@ SPEC REPOS: - Firebase - FirebaseAnalytics - FirebaseCore + - FirebaseCoreExtension - FirebaseCoreInternal + - FirebaseCrashlytics - FirebaseInstallations - FirebaseMessaging + - FirebaseRemoteConfigInterop + - FirebaseSessions - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities - nanopb - OrderedSet - PromisesObjC + - PromisesSwift - SDWebImage - SwiftyGif @@ -243,6 +279,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_analytics/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_crashlytics: + :path: ".symlinks/plugins/firebase_crashlytics/ios" firebase_messaging: :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: @@ -282,12 +320,17 @@ SPEC CHECKSUMS: Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 firebase_analytics: 0627e95b73eb9e04f59167687ed5bc3f6fb50f23 firebase_core: 483cfad66d24d8f3c233f31db4263830c625c909 + firebase_crashlytics: 8f04c663c8734f97c4ccbe81b8511ce7060e3b28 firebase_messaging: e60c0694699d8a2e56a319e043709583f6544123 FirebaseAnalytics: f9211b719db260cc91aebee8bb539cb367d0dfd1 FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 + FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 + FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293 FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e + FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d + FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 @@ -302,6 +345,7 @@ SPEC CHECKSUMS: path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 @@ -311,6 +355,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 -PODFILE CHECKSUM: f2b7abe080b8e8f49e642b85431f5117d22149fe +PODFILE CHECKSUM: d7f4d1b71f8c708247c1078c4aec33a28c763405 COCOAPODS: 1.15.2 diff --git a/lib/modals/filters/selections/index.dart b/ios/Podfile.lock:Zone.Identifier similarity index 100% rename from lib/modals/filters/selections/index.dart rename to ios/Podfile.lock:Zone.Identifier diff --git a/lib/modals/forms/change_password/index.dart b/ios/Podfile:Zone.Identifier similarity index 100% rename from lib/modals/forms/change_password/index.dart rename to ios/Podfile:Zone.Identifier diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9ace6cd2..53994b42 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -51,6 +51,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6436409727A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409027A31CD400820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C1B4A503715BC7B0F8826983 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -299,6 +301,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( + 6436409727A31CDC00820AF7 /* pt */, + 6436409027A31CD400820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -363,7 +367,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -458,7 +462,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -507,7 +511,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/modals/forms/forgot_password/index.dart b/ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier similarity index 100% rename from lib/modals/forms/forgot_password/index.dart rename to ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier diff --git a/lib/modals/forms/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier similarity index 100% rename from lib/modals/forms/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier diff --git a/lib/modals/forms/qr_code/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier similarity index 100% rename from lib/modals/forms/qr_code/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier diff --git a/lib/modals/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier similarity index 100% rename from lib/modals/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier diff --git a/lib/modals/notifications/access_notification/index.dart b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier similarity index 100% rename from lib/modals/notifications/access_notification/index.dart rename to ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier diff --git a/lib/modals/notifications/index.dart b/ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier similarity index 100% rename from lib/modals/notifications/index.dart rename to ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier diff --git a/lib/modals/notifications/message_notificaion/index.dart b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier similarity index 100% rename from lib/modals/notifications/message_notificaion/index.dart rename to ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier diff --git a/lib/modals/notifications/visit_request/index.dart b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier similarity index 100% rename from lib/modals/notifications/visit_request/index.dart rename to ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier diff --git a/lib/modals/selection/bottom_arrow_linked_locals/index.dart b/ios/Runner/AppDelegate.swift:Zone.Identifier similarity index 100% rename from lib/modals/selection/bottom_arrow_linked_locals/index.dart rename to ios/Runner/AppDelegate.swift:Zone.Identifier diff --git a/lib/modals/selection/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier diff --git a/lib/modals/selection/top_arrow_linked_locals/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/top_arrow_linked_locals/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier diff --git a/lib/modals/selection/up_arrow_linked_locals/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/up_arrow_linked_locals/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier diff --git a/lib/pages/consults/access/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/access/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier diff --git a/lib/pages/consults/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier diff --git a/lib/pages/consults/liberation/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/liberation/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier diff --git a/lib/pages/consults/message/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/message/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier diff --git a/lib/pages/consults/poeple/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/poeple/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier diff --git a/lib/pages/consults/qrcode/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/qrcode/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier diff --git a/lib/pages/consults/visit/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/visit/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier diff --git a/lib/pages/home/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier similarity index 100% rename from lib/pages/home/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier diff --git a/lib/pages/onboarding/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier similarity index 100% rename from lib/pages/onboarding/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier diff --git a/lib/pages/registers/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier similarity index 100% rename from lib/pages/registers/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier diff --git a/lib/pages/registers/visitor/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier similarity index 100% rename from lib/pages/registers/visitor/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier diff --git a/lib/pages/schedules/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier similarity index 100% rename from lib/pages/schedules/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier diff --git a/lib/pages/schedules/visit/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier similarity index 100% rename from lib/pages/schedules/visit/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier diff --git a/lib/pages/settings/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier similarity index 100% rename from lib/pages/settings/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/GoogleService-Info.plist:Zone.Identifier b/ios/Runner/GoogleService-Info.plist:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Info.plist:Zone.Identifier b/ios/Runner/Info.plist:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier b/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier b/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Runner.entitlements:Zone.Identifier b/ios/Runner/Runner.entitlements:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart new file mode 100644 index 00000000..d7a4ae22 --- /dev/null +++ b/lib/actions/actions.dart @@ -0,0 +1,781 @@ +import 'dart:developer'; + +// 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'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/custom_code/actions/get_dev_u_u_i_d.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/random_data_util.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +import '../shared/utils/log_util.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} + +Future repeatVisitScheduleAction( + BuildContext context, { + List? visitorJsonList, + String? visitorStrList, + String? visitStartDateStr, + String? visitEndDateStr, + String? visitReasonStr, + String? visitLevelStr, + bool? visitTempBol, + String? visitObsStr, +}) async { + context.pushNamed( + 'scheduleCompleteVisitPage', + queryParameters: { + 'visitStartDateStr': serializeParam( + visitStartDateStr, + ParamType.String, + ), + 'visitEndDateStr': serializeParam( + visitEndDateStr, + ParamType.String, + ), + 'visitReasonStr': serializeParam( + visitReasonStr, + ParamType.String, + ), + 'visitLevelStr': serializeParam( + visitLevelStr, + ParamType.String, + ), + 'visitTempBol': serializeParam( + visitTempBol, + ParamType.bool, + ), + 'visitObsStr': serializeParam( + visitObsStr, + ParamType.String, + ), + 'visitorStrList': serializeParam( + visitorStrList, + ParamType.String, + ), + 'visitorJsonList': serializeParam( + visitorJsonList, + ParamType.JSON, + isList: true, + ), + }.withoutNulls, + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future manageStatusColorAction( + BuildContext context, { + required String? visitStatusStr, +}) async { + log('visitStatusStr: $visitStatusStr'); + if (visitStatusStr == 'A') { + return FlutterFlowTheme.of(context).success; + } else if ((visitStatusStr == 'C') || + (visitStatusStr == 'F') || + (visitStatusStr == 'B') || + (visitStatusStr == 'I')) { + return FlutterFlowTheme.of(context).error; + } + + return FlutterFlowTheme.of(context).warning; +} + +Future singInLoginAction( + BuildContext context, { + String? emailAdress, + String? password, +}) async { + try { + String? devUUID; + ApiCallResponse? loginCall; + + await Future.wait([ + Future(() async { + FFAppState().email = emailAdress!; + }), + Future(() async { + FFAppState().passwd = password!; + }), + ]); + + if ((FFAppState().email != '') && (FFAppState().passwd != '')) { + devUUID = await getDevUUID(); + + FFAppState().devUUID = devUUID!; + + loginCall = await PhpGroup.loginCall.call( + email: FFAppState().email, + password: FFAppState().passwd, + uuid: FFAppState().devUUID, + type: FFAppState().device, + description: randomString( + 10, + 10, + true, + false, + false, + ), + ); + + if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { + FFAppState().userUUID = PhpGroup.loginCall.userUUID( + (loginCall.jsonBody ?? ''), + )!; + + FFAppState().createdAt = dateTimeFormat( + 'd/M/y H:mm:ss', + getCurrentTimestamp, + locale: FFLocalizations.of(context).languageCode, + ); + + FFAppState().updatedAt = '00/00/0000 00:00:00'; + + FFAppState().status = + PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; + + FFAppState().userDevUUID = + PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; + + FFAppState().name = + PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; + + FFAppState().serialNumber = await getSerialNumber() ?? ''; + + FFAppState().isLogged = true; + + await toggleHomePage(context); + } else { + if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { + DialogUtil.errorDefault(context); + } else { + DialogUtil.error(context, + PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); + } + + FFAppState().deleteEmail(); + FFAppState().email = ''; + + FFAppState().deletePasswd(); + FFAppState().passwd = ''; + + FFAppState().update(() {}); + } + } + + return; + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'login.php', emailAdress.toString(), "Login", e, s); + } +} + +Future signUpRegisterAction( + BuildContext context, { + required String? name, + String? passwd, + required String? email, + String? device, +}) async { + try { + ApiCallResponse? registerCall; + if ((email != null && email != '') && + (passwd != null && passwd != '' && passwd.length > 7) && + (name != null && name != '')) { + registerCall = await PhpGroup.registerCall.call( + name: name, + password: passwd, + email: email, + token: randomString( + 36, + 36, + false, + false, + true, + ), + uuid: randomString( + 36, + 36, + false, + false, + true, + ), + tipo: device, + descricao: randomString( + 36, + 36, + true, + false, + false, + ), + ); + + if (PhpGroup.registerCall.error( + (registerCall.jsonBody ?? ''), + ) == + false) { + return true; + } + final errorMessage = registerCall?.jsonBody['error_msg']; + DialogUtil.error(context, errorMessage); + return false; + } else { + DialogUtil.errorDefault(context); + return false; + } + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'registro.php', email.toString(), "Register", e, s); + return false; + } +} + +Future forgotPasswdAction( + BuildContext context, { + required String? email, +}) async { + ApiCallResponse? forgotPasswd; + + forgotPasswd = await PhpGroup.forgotPasswordCall.call( + email: email, + ); + + if (PhpGroup.forgotPasswordCall.error( + (forgotPasswd.jsonBody ?? ''), + ) != + false) { + return; + } +} + +Future cachingLoginActionApp(BuildContext context) async { + if (FFAppState().isLogged == true) { + context.pushNamed('homePage'); + } else { + if (isAndroid == true) { + FFAppState().device = 'Android'; + } else if (isiOS == true) { + FFAppState().device = 'iOS'; + } else { + FFAppState().device = 'Web'; + } + } +} + +Future toggleSignInPage(BuildContext context) async { + context.pushNamed( + 'signInPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( + 'signUpPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future toggleHomePage(BuildContext context) async { + context.goNamed( + 'homePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future visitRequestComponentAction( + BuildContext context, { + required String? actionValue, + required String? refUUID, + required String? responseValue, + required String? vteUUID, +}) async { + ApiCallResponse? respondeSolicitacaoCall; + + respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'respondeSolicitacao', + referencia: refUUID, + tarefa: actionValue, + resposta: responseValue, + idVisitante: vteUUID, + ); + + if (respondeSolicitacaoCall.statusCode == 200) { + return true; + } else { + log('headers: ${respondeSolicitacaoCall.headers}'); + log('bodyText: ${respondeSolicitacaoCall.bodyText}'); + log('jsonBody: ${respondeSolicitacaoCall.jsonBody}'); + log('userUUID: ${FFAppState().userUUID}'); + log('devUUID: ${FFAppState().devUUID}'); + log('cliUUID: ${FFAppState().cliUUID}'); + log('atividade: respondeSolicitacao'); + log('referencia: $refUUID'); + log('tarefa: $actionValue'); + log('resposta: $responseValue'); + log('idVisitante: $vteUUID'); + return false; + } +} + +Future snackbar(BuildContext context, {required bool opt}) async { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + elevation: 10, + margin: const EdgeInsets.all(50), + content: Center( + child: Text( + opt + ? FFLocalizations.of(context).getText('asjd2q3k2j4l21') + : FFLocalizations.of(context).getText('asda2e42fafa'), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.normal, + color: FlutterFlowTheme.of(context).info, + ), + ), + ), + backgroundColor: opt + ? FlutterFlowTheme.of(context).success.withOpacity(0.5) + : FlutterFlowTheme.of(context).error.withOpacity(0.5), + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + ), + ); +} + +Future checkLocals({ + String? cliUUID, + required BuildContext context, + required HomePageModel model, + required void Function(void Function()) safeSetState, +}) async { + // A chamada para a API permanece a mesma, assumindo que é necessária sempre. + final response = await PhpGroup.getLocalsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ); + + // Verificação rápida de erro para evitar processamento desnecessário. + if (response.jsonBody['error']) { + log("checkLocals => Erro encontrado na resposta"); + return false; + } + + // Uso eficiente de coleções para verificar a condição desejada. + final String uuid = cliUUID ?? FFAppState().cliUUID; + final bool 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) { + log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A"); + return true; + } else { + log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A"); + // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: 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. + return false; + } +} + +Future changeStatusAction( + BuildContext context, + String status, + String vawREF, + String msg, + String vteUUID, +) async { + log('status: $status'); + + switch (status) { + case 'L': + Navigator.pop(context, true); + + bool? approveVisitRequest; + approveVisitRequest = await visitRequestComponentAction( + context, + actionValue: status, + refUUID: vawREF, + responseValue: msg, + vteUUID: vteUUID, + ); + if (!context.mounted) return; + if (approveVisitRequest == true) { + log('Aprovado'); + } else { + log('Erro ao aprovar'); + } + break; + case 'B': + Navigator.pop(context, true); + + bool? blockVisitRequest; + blockVisitRequest = await visitRequestComponentAction( + context, + actionValue: status, + refUUID: vawREF, + responseValue: msg, + vteUUID: vteUUID, + ); + if (!context.mounted) return; + if (blockVisitRequest == true) { + log('Bloqueado'); + } else { + log('Erro ao bloquear'); + } + break; + default: + break; + } +} + +/// QR Code + +Uint8List assembleQRPacket(int direction, String identifier, String password) { + List packet = [direction]; + + String paddedBadge = identifier.padLeft(30, '0'); + + log("Badge: $paddedBadge"); + + for (var i = 0; i < paddedBadge.length; i += 2) { + packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16)); + } + + DateTime now = DateTime.now(); + int year = now.year % 100; + int month = now.month; + int day = now.day; + int hour = now.hour; + int minute = now.minute; + + int sum = year + month + day + hour + minute; + + if (sum == int.parse('0D', radix: 16) || sum == int.parse('0A', radix: 16)) { + packet.add(int.parse('FF', radix: 16)); + } else { + packet.add(sum); + } + + String paddedPassword = password.length != 4 ? 'FFFF' : password; + + for (var i = 0; i < paddedPassword.length; i += 2) { + packet.add(int.parse(paddedPassword.substring(i, i + 2), radix: 16)); + } + + int check = 0x00; + + for (var b in packet) { + check ^= b; + } + + if (check == int.parse('0D', radix: 16) || + check == int.parse('0A', radix: 16)) { + packet.add(int.parse('FF', radix: 16)); + } else { + packet.add(check); + } + + var bytes = + packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); + + log("Pacote: $packet"); + log("Bytes: $bytes"); + return Uint8List.fromList(packet); +} + +Uint8List hexStringToByteArray(String s) { + int len = s.length; + Uint8List data = Uint8List(len ~/ 2); + for (int i = 0; i < len; i += 2) { + data[i ~/ 2] = + ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); + } + return data; +} + +String byteToHexa(Uint8List pDados) { + return pDados + .map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()) + .join(); +} + +Future byteToString(Uint8List bytes) async { + return String.fromCharCodes(bytes); +} + +Widget buildQrCode( + { + // required String data, + // required String type, + // required int version, + // required int maskPattern, + required int errorCorrectLevel, + required double dimension, + required String identifier, + required String pass, + required int direction}) { + try { + log("pass: $pass"); + const Color backgroundColor = Colors.white; + const Color foregroundColor = Colors.black; + return QrImageView.withQr( + qr: QrCode.fromUint8List( + data: assembleQRPacket(direction, identifier, pass), + errorCorrectLevel: errorCorrectLevel), + size: dimension, + padding: const EdgeInsets.all(10), + backgroundColor: backgroundColor, + foregroundColor: foregroundColor); + } catch (e) { + return Text("Erro ao gerar QR Code: ${e.toString()}"); + } +} + +// // Retorna o conteúdo a ser codificado no QR Code. +// String getContents() { +// return data; +// } + +// // Retorna uma versão do conteúdo otimizada para exibição. +// String getDisplayContents() { +// return data.trim(); +// } + +// // Retorna o título baseado no tipo de conteúdo. +// String getTitle() { +// return type; +// } + +// // Codifica o conteúdo em uma string adequada para o QR Code. +// Future encodeContents() async { +// // Implementação específica para codificar o conteúdo. +// return data; // Exemplo simplificado. +// } + +// // Codifica o conteúdo específico do QR Code. +// Future encodeQRCodeContents() async { +// return getQrCode(); +// } + +// // Gera o QR Code como um widget. + +// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). +// // Future encodeAsBitmap() async { +// // // Implementação para codificar como bitmap. +// // return Image(image); // Exemplo simplificado. +// // } + +// // Adivinha a codificação apropriada para o conteúdo. +// String guessAppropriateEncoding(String content) { +// // Implementação para adivinhar a codificação. +// return "UTF-8"; // Exemplo simplificado. +// } + +// // Remove espaços em branco do início e do fim do conteúdo. +// String trim(String content) { +// return content.trim(); +// } + +// // Escapa caracteres especiais para o formato MECARD. +// String escapeMECARD(String content) { +// // Implementação para escapar caracteres. +// return content.replaceAll(':', '\\:'); // Exemplo simplificado. +// } + +/// menu + +Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], + ), + ); + }, + ); +} + +Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], + ), + ); + }, + ); +} + +Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} diff --git a/lib/actions/actions.dart:Zone.Identifier b/lib/actions/actions.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/app_state.dart b/lib/app_state.dart index c16883dc..115951d0 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,11 +1,9 @@ // import 'dart:ffi'; -import 'commons/widgets/permissions_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:csv/csv.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:synchronized/synchronized.dart'; class FFAppState extends ChangeNotifier { @@ -19,7 +17,7 @@ class FFAppState extends ChangeNotifier { // Verifica suporte biométrico Future checkBiometrics() async { try { - return await auth.canCheckBiometrics; + return await auth.canCheckBiometrics; } catch (e) { clearBiometricAuthentication(); debugPrint('Error checking biometrics: $e'); @@ -32,14 +30,13 @@ class FFAppState extends ChangeNotifier { bool authenticated = false; try { authenticated = await auth.authenticate( - localizedReason: 'Scan your fingerprint to authenticate', - options: const AuthenticationOptions( - biometricOnly: true, - stickyAuth: true, - useErrorDialogs: true, - sensitiveTransaction: true, - ) - ); + localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions( + biometricOnly: true, + stickyAuth: true, + useErrorDialogs: true, + sensitiveTransaction: true, + )); if (authenticated) { _isBiometricAuthenticated = true; notifyListeners(); @@ -52,7 +49,8 @@ class FFAppState extends ChangeNotifier { clearBiometricAuthentication(); return Future.error(e); } - return Future.error(''); // Add this line to ensure a value is always returned + return Future.error( + ''); // Add this line to ensure a value is always returned } // Função para limpar o estado de autenticação biométrica @@ -62,9 +60,6 @@ class FFAppState extends ChangeNotifier { // Limpar a informação salva, se necessário } - - - static FFAppState _instance = FFAppState._internal(); factory FFAppState() { @@ -125,13 +120,16 @@ class FFAppState extends ChangeNotifier { _tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS; }); await _safeInitAsync(() async { - _userDevUUID = await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; + _userDevUUID = + await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; }); await _safeInitAsync(() async { - _serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber; + _serialNumber = + await secureStorage.getString('ff_serialNumber') ?? _serialNumber; }); await _safeInitAsync(() async { - _fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; + _fingerprintOPT = + await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; }); await _safeInitAsync(() async { _personOPT = await secureStorage.getBool('person') ?? _personOPT; @@ -139,6 +137,9 @@ class FFAppState extends ChangeNotifier { await _safeInitAsync(() async { _passOPT = await secureStorage.getBool('pass') ?? _passOPT; }); + await _safeInitAsync(() async { + _panicOPT = await secureStorage.getBool('panic') ?? _panicOPT; + }); await _safeInitAsync(() async { _notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT; }); @@ -149,9 +150,9 @@ class FFAppState extends ChangeNotifier { _panicPass = await secureStorage.getString('panicPass') ?? _panicPass; }); await _safeInitAsync(() async { - _fingerprintPass = await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; + _fingerprintPass = + await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; }); - } void update(VoidCallback callback) { @@ -161,6 +162,17 @@ class FFAppState extends ChangeNotifier { late FlutterSecureStorage secureStorage; + bool _panicOPT = false; + bool get panic => _panicOPT; + set panic(bool value) { + _panicOPT = value; + secureStorage.setBool('panic', value); + } + + void deletePanic() { + secureStorage.delete(key: 'panic'); + } + String _fingerprintPass = ''; String get fingerprintPass => _fingerprintPass; set fingerprintPass(String value) { @@ -187,8 +199,7 @@ class FFAppState extends ChangeNotifier { String get panicPass => _panicPass; set panicPass(String value) { _panicPass = value; - secureStorage.setString - ('panicPass', value); + secureStorage.setString('panicPass', value); } void deletePanicPass() { @@ -205,8 +216,7 @@ class FFAppState extends ChangeNotifier { bool _passOPT = false; bool get pass => _passOPT; set pass(bool value) { - _passOPT = - value; + _passOPT = value; secureStorage.setBool('pass', value); } diff --git a/lib/app_state.dart:Zone.Identifier b/lib/app_state.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/api_calls.dart b/lib/backend/api_requests/api_calls.dart similarity index 99% rename from lib/commons/actions/api_calls.dart rename to lib/backend/api_requests/api_calls.dart index 67ec207f..2a8838ec 100644 --- a/lib/commons/actions/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -4,13 +4,14 @@ import 'dart:developer'; import 'package:flutter/foundation.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'api_manager.dart'; export 'api_manager.dart' show ApiCallResponse; const _kPrivateApiFunctionName = 'ffPrivateApiCall'; + /// Start PHP Group Code class PhpGroup { @@ -2432,4 +2433,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { } return isList ? '[]' : '{}'; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_calls.dart:Zone.Identifier b/lib/backend/api_requests/api_calls.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/api_manager.dart b/lib/backend/api_requests/api_manager.dart similarity index 99% rename from lib/commons/actions/api_manager.dart rename to lib/backend/api_requests/api_manager.dart index dcb91c8a..53340d4f 100644 --- a/lib/commons/actions/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -11,10 +11,13 @@ import 'package:equatable/equatable.dart'; import 'package:http_parser/http_parser.dart'; import 'package:mime_type/mime_type.dart'; -import '/commons/widgets/uploaded_file.dart'; +import '/flutter_flow/uploaded_file.dart'; import 'get_streamed_response.dart'; + + + enum ApiCallType { GET, POST, @@ -512,4 +515,4 @@ class ApiManager { return result; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_manager.dart:Zone.Identifier b/lib/backend/api_requests/api_manager.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/get_streamed_response.dart b/lib/backend/api_requests/get_streamed_response.dart similarity index 77% rename from lib/commons/actions/get_streamed_response.dart rename to lib/backend/api_requests/get_streamed_response.dart index 1a53aab0..303a19e5 100644 --- a/lib/commons/actions/get_streamed_response.dart +++ b/lib/backend/api_requests/get_streamed_response.dart @@ -1,4 +1,4 @@ import 'package:http/http.dart'; Future getStreamedResponse(Request request) => - Client().send(request); + Client().send(request); \ No newline at end of file diff --git a/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier b/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart similarity index 94% rename from lib/commons/actions/pushNotificationService.dart rename to lib/backend/push_notification/pushNotificationService.dart index c8dfa7f5..883a9338 100644 --- a/lib/commons/actions/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -4,18 +4,24 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/actions/api_manager.dart'; + + import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:hub/modals/notifications/access_notification/widget.dart'; -import 'package:hub/modals/notifications/message_notificaion/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:rxdart/rxdart.dart'; +// + + class PushNotificationService { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = @@ -128,7 +134,7 @@ class PushNotificationService { log('Notification payload: $message'); var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage log('Extra: ${data.value}'); - _handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'}); + _handleNotificationClick(message, extra: data.value); } catch (e) { log('Error decoding notification payload: $e'); } @@ -359,7 +365,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: AccessNotificationModalTemplateComponentWidget( @@ -407,7 +413,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: VisitRequestTemplateComponentWidget( @@ -415,8 +421,8 @@ class NotificationHandler { vteReason: message['motivo'] ?? 'Unknown', vteMsg: message['mensagem'] ?? 'Unknown', vteDocument: message['documento'] ?? '', - vteUUID: message['idVisitante'].toString() ?? '0', - vawRef: message['referencia'].toString() ?? '0', + vteUUID: message['idVisitante'].toString(), + vawRef: message['referencia'].toString(), vawStatus: 'S', changeStatusAction: changeStatusAction, ), @@ -444,4 +450,4 @@ class PushNotificationManager { } -} +} \ No newline at end of file diff --git a/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier b/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/tapNotifcationActivity.dart b/lib/backend/push_notification/tapNotifcationActivity.dart similarity index 95% rename from lib/commons/actions/tapNotifcationActivity.dart rename to lib/backend/push_notification/tapNotifcationActivity.dart index 064ee82b..1ee22050 100644 --- a/lib/commons/actions/tapNotifcationActivity.dart +++ b/lib/backend/push_notification/tapNotifcationActivity.dart @@ -1,4 +1,4 @@ -// import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; // import 'package:firebase_messaging/firebase_messaging.dart'; // import 'package:flutter/material.dart'; // import 'package:rxdart/rxdart.dart'; diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier b/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/enums/enums.dart b/lib/backend/schema/enums/enums.dart similarity index 99% rename from lib/commons/schema/enums/enums.dart rename to lib/backend/schema/enums/enums.dart index bb6ac511..64351084 100644 --- a/lib/commons/schema/enums/enums.dart +++ b/lib/backend/schema/enums/enums.dart @@ -32,4 +32,4 @@ T? deserializeEnum(String? value) { default: return null; } -} +} \ No newline at end of file diff --git a/lib/backend/schema/enums/enums.dart:Zone.Identifier b/lib/backend/schema/enums/enums.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/structs/device_struct.dart b/lib/backend/schema/structs/device_struct.dart similarity index 96% rename from lib/commons/schema/structs/device_struct.dart rename to lib/backend/schema/structs/device_struct.dart index 6ffaeaae..174afa98 100644 --- a/lib/commons/schema/structs/device_struct.dart +++ b/lib/backend/schema/structs/device_struct.dart @@ -1,9 +1,10 @@ // ignore_for_file: unnecessary_getters_setters -import '/commons/schema/util/schema_util.dart'; + +import 'package:hub/flutter_flow/nav/nav.dart'; import 'index.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + class DeviceStruct extends BaseStruct { DeviceStruct({ @@ -110,4 +111,4 @@ DeviceStruct createDeviceStruct({ devUUID: devUUID, version: version, description: description, - ); + ); \ No newline at end of file diff --git a/lib/backend/schema/structs/device_struct.dart:Zone.Identifier b/lib/backend/schema/structs/device_struct.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/backend/schema/structs/index.dart b/lib/backend/schema/structs/index.dart new file mode 100644 index 00000000..4affa264 --- /dev/null +++ b/lib/backend/schema/structs/index.dart @@ -0,0 +1,3 @@ +export '/backend/schema/util/schema_util.dart'; + +export 'device_struct.dart'; diff --git a/lib/backend/schema/structs/index.dart:Zone.Identifier b/lib/backend/schema/structs/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/util/schema_util.dart b/lib/backend/schema/util/schema_util.dart similarity index 91% rename from lib/commons/schema/util/schema_util.dart rename to lib/backend/schema/util/schema_util.dart index b788a544..80a9f7a4 100644 --- a/lib/commons/schema/util/schema_util.dart +++ b/lib/backend/schema/util/schema_util.dart @@ -2,9 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:from_css_color/from_css_color.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + -import '/commons/schema/enums/enums.dart'; -import '/commons/widgets/flutter_flow_util.dart'; export 'package:collection/collection.dart' show ListEquality; export 'package:flutter/material.dart' show Color, Colors; @@ -77,4 +79,4 @@ List? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls; List? getDataList(dynamic value) => - value is! List ? null : value.map((e) => castToType(e)!).toList(); + value is! List ? null : value.map((e) => castToType(e)!).toList(); \ No newline at end of file diff --git a/lib/backend/schema/util/schema_util.dart:Zone.Identifier b/lib/backend/schema/util/schema_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/actions.dart b/lib/commons/actions/actions.dart deleted file mode 100644 index b16ce6e8..00000000 --- a/lib/commons/actions/actions.dart +++ /dev/null @@ -1,814 +0,0 @@ -import 'dart:convert'; -import 'dart:developer'; - -// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import 'package:hub/pages/home/model.dart'; -import 'package:hub/pages/home/widget.dart'; -import 'package:hub/commons/actions/get_dev_u_u_i_d.dart'; -import 'package:flutter/material.dart'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:sqflite/utils/utils.dart'; - -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/actions/api_calls.dart'; -import '/commons/actions/index.dart' as actions; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/random_data_util.dart' as random_data; - - -import 'package:url_launcher/url_launcher.dart'; - -Future openTermsOfUse(BuildContext context) async { - log('openTermsOfUse'); - final Uri url = Uri.parse('https://freaccess.com.br/pp/'); - if (!await launchUrl(url)) { - throw Exception('Could not launch $url'); - } -} - -Future repeatVisitScheduleAction( - BuildContext context, { - List? visitorJsonList, - String? visitorStrList, - String? visitStartDateStr, - String? visitEndDateStr, - String? visitReasonStr, - String? visitLevelStr, - bool? visitTempBol, - String? visitObsStr, -}) async { - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'visitStartDateStr': serializeParam( - visitStartDateStr, - ParamType.String, - ), - 'visitEndDateStr': serializeParam( - visitEndDateStr, - ParamType.String, - ), - 'visitReasonStr': serializeParam( - visitReasonStr, - ParamType.String, - ), - 'visitLevelStr': serializeParam( - visitLevelStr, - ParamType.String, - ), - 'visitTempBol': serializeParam( - visitTempBol, - ParamType.bool, - ), - 'visitObsStr': serializeParam( - visitObsStr, - ParamType.String, - ), - 'visitorStrList': serializeParam( - visitorStrList, - ParamType.String, - ), - 'visitorJsonList': serializeParam( - visitorJsonList, - ParamType.JSON, - isList: true, - ), - }.withoutNulls, - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future manageStatusColorAction( - BuildContext context, { - required String? visitStatusStr, -}) async { - log('visitStatusStr: $visitStatusStr'); - if (visitStatusStr == 'A') { - return FlutterFlowTheme.of(context).success; - } else if ((visitStatusStr == 'C') || - (visitStatusStr == 'F') || - (visitStatusStr == 'B') || - (visitStatusStr == 'I')) { - return FlutterFlowTheme.of(context).error; - } - - return FlutterFlowTheme.of(context).warning; -} - -Future singInLoginAction( - BuildContext context, { - String? emailAdress, - String? password, -}) async { - String? devUUID; - ApiCallResponse? loginCall; - - await Future.wait([ - Future(() async { - FFAppState().email = emailAdress!; - }), - Future(() async { - FFAppState().passwd = password!; - }), - ]); - if ((FFAppState().email != '') && (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); - FFAppState().devUUID = devUUID!; - loginCall = await PhpGroup.loginCall.call( - email: FFAppState().email, - password: FFAppState().passwd, - uuid: FFAppState().devUUID, - type: FFAppState().device, - description: random_data.randomString( - 10, - 10, - true, - false, - false, - ), - ); - - if (PhpGroup.loginCall.error( - (loginCall.jsonBody ?? ''), - ) == - false) { - FFAppState().userUUID = PhpGroup.loginCall.userUUID( - (loginCall.jsonBody ?? ''), - )!; - // FFAppState().token = await FirebaseMessaging.instance.getToken(); - FFAppState().createdAt = dateTimeFormat( - 'd/M/y H:mm:ss', - getCurrentTimestamp, - locale: FFLocalizations.of(context).languageCode, - ); - FFAppState().updatedAt = '00/00/0000 00:00:00'; - FFAppState().status = PhpGroup.loginCall.userStatus( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().name = PhpGroup.loginCall.userName( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().serialNumber = await getSerialNumber() ?? ''; - FFAppState().isLogged = true; - await action_blocks.toggleHomePage(context); - return; - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.loginCall.msg( - (loginCall?.jsonBody ?? ''), - )!, - ), - ); - }, - ); - - FFAppState().deleteEmail(); - FFAppState().email = ''; - - FFAppState().deletePasswd(); - FFAppState().passwd = ''; - - FFAppState().update(() {}); - } - - return; - } else { - return; - } -} - -Future signUpRegisterAction( - BuildContext context, { - required String? name, - String? passwd, - required String? email, - String? device, -}) async { - ApiCallResponse? registerCall; - - if ((email != null && email != '') && - (passwd != null && passwd != '') && - (name != null && name != '')) { - registerCall = await PhpGroup.registerCall.call( - name: name, - password: passwd, - email: email, - token: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - uuid: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - tipo: device, - descricao: random_data.randomString( - 36, - 36, - true, - false, - false, - ), - ); - - if (PhpGroup.registerCall.error( - (registerCall.jsonBody ?? ''), - ) == - false) { - return true; - } - - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: const Text('Error'), - content: Text('${registerCall?.jsonBody}'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR2 '), - ), - ], - ); - }, - ); - return false; - } else { - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: Text(FFLocalizations.of(context).getVariableText( - enText: 'Error', - ptText: 'Erro', - )), - content: Text(FFLocalizations.of(context).getVariableText( - enText: 'Please fill in all fields', - ptText: 'Por favor, preencha todos os campos', - )), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: Text(FFLocalizations.of(context).getVariableText( - ptText: 'Fechar', - enText: 'Close', - )), - ), - ], - ); - }, - ); - return false; - } -} - -Future forgotPasswdAction( - BuildContext context, { - required String? email, -}) async { - ApiCallResponse? forgotPasswd; - - forgotPasswd = await PhpGroup.forgotPasswordCall.call( - email: email, - ); - - if (PhpGroup.forgotPasswordCall.error( - (forgotPasswd.jsonBody ?? ''), - ) != - false) { - return; - } -} - -Future cachingLoginActionApp(BuildContext context) async { - if (FFAppState().isLogged == true) { - context.pushNamed('homePage'); - } else { - if (isAndroid == true) { - FFAppState().device = 'Android'; - } else if (isiOS == true) { - FFAppState().device = 'iOS'; - } else { - FFAppState().device = 'Web'; - } - } -} - -Future toggleSignInPage(BuildContext context) async { - context.pushNamed( - 'signInPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future toggleSignUpPage(BuildContext context) async { - - context.pushNamed( - 'signUpPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future toggleHomePage(BuildContext context) async { - context.goNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future visitRequestComponentAction( - BuildContext context, { - required String? actionValue, - required String? refUUID, - required String? responseValue, - required String? vteUUID, -}) async { - ApiCallResponse? respondeSolicitacaoCall; - - respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'respondeSolicitacao', - referencia: refUUID, - tarefa: actionValue, - resposta: responseValue, - idVisitante: vteUUID, - ); - - if (respondeSolicitacaoCall.statusCode == 200) { - return true; - } else { - log('headers: ${respondeSolicitacaoCall.headers}'); - log('bodyText: ${respondeSolicitacaoCall.bodyText}'); - log('jsonBody: ${respondeSolicitacaoCall.jsonBody}'); - log('userUUID: ${FFAppState().userUUID}'); - log('devUUID: ${FFAppState().devUUID}'); - log('cliUUID: ${FFAppState().cliUUID}'); - log('atividade: respondeSolicitacao'); - log('referencia: $refUUID'); - log('tarefa: $actionValue'); - log('resposta: $responseValue'); - log('idVisitante: $vteUUID'); - return false; - } -} - -Future snackbar(BuildContext context, {required bool opt}) async { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - elevation: 10, - margin: const EdgeInsets.all(50), - content: Center( - child: Text( - opt - ? FFLocalizations.of(context).getText('asjd2q3k2j4l21') - : FFLocalizations.of(context).getText('asda2e42fafa'), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.normal, - color: FlutterFlowTheme.of(context).info, - ), - ), - ), - backgroundColor: opt - ? FlutterFlowTheme.of(context).success.withOpacity(0.5) - : FlutterFlowTheme.of(context).error.withOpacity(0.5), - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - ), - ); -} - -Future checkLocals({ - String? cliUUID, - required BuildContext context, - required HomePageModel model, - required void Function(void Function()) safeSetState, -}) async { - // A chamada para a API permanece a mesma, assumindo que é necessária sempre. - final response = await PhpGroup.getLocalsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ); - - // Verificação rápida de erro para evitar processamento desnecessário. - if (response.jsonBody['error']) { - log("checkLocals => Erro encontrado na resposta"); - return false; - } - - // Uso eficiente de coleções para verificar a condição desejada. - final String uuid = cliUUID ?? FFAppState().cliUUID; - final bool 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) { - log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A"); - return true; - } else { - log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A"); - // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: 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. - return false; - } -} - - -Future changeStatusAction( - BuildContext context, - String status, - String vawREF, - String msg, - String vteUUID, -) async { - log('status: $status'); - - switch (status) { - case 'L': - Navigator.pop(context, true); - - bool? approveVisitRequest; - approveVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (approveVisitRequest == true) { - log('Aprovado'); - } else { - log('Erro ao aprovar'); - } - break; - case 'B': - Navigator.pop(context, true); - - bool? blockVisitRequest; - blockVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (blockVisitRequest == true) { - log('Bloqueado'); - } else { - log('Erro ao bloquear'); - } - break; - default: - break; - } - - -} - - -/// QR Code - - -Uint8List assembleQRPacket(int direction, String identifier, String password) { - List packet = [direction]; - - String paddedBadge = identifier.padLeft(30, '0'); - - log("Badge: $paddedBadge"); - - for (var i = 0; i < paddedBadge.length; i += 2) { - packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16)); - } - - DateTime now = DateTime.now(); - int year = now.year % 100; - int month = now.month; - int day = now.day; - int hour = now.hour; - int minute = now.minute; - - int sum = year + month + day + hour + minute; - - if (sum == int.parse('0D', radix: 16) || sum == int.parse('0A', radix: 16)) { - packet.add(int.parse('FF', radix: 16)); - } else { - packet.add(sum); - } - - String paddedPassword = password.length != 4 ? 'FFFF' : password; - - for (var i = 0; i < paddedPassword.length; i += 2) { - packet.add(int.parse(paddedPassword.substring(i, i + 2), radix: 16)); - } - - int check = 0x00; - - for (var b in packet) { - check ^= b; - } - - if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) { - packet.add(int.parse('FF', radix: 16)); - } else { - packet.add(check); - } - - var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); - - log("Pacote: $packet"); - log("Bytes: $bytes"); - return Uint8List.fromList(packet); -} - -Uint8List hexStringToByteArray(String s) { - int len = s.length; - Uint8List data = Uint8List(len ~/ 2); - for (int i = 0; i < len; i += 2) { - data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); - } - return data; -} - -String byteToHexa(Uint8List pDados) { - return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join(); -} - -Future byteToString(Uint8List bytes) async { - return String.fromCharCodes(bytes); -} - - -Widget buildQrCode( -{ - // required String data, - // required String type, - // required int version, - // required int maskPattern, - required int errorCorrectLevel, - required double dimension, - required String identifier, - required String pass, - required int direction - } - ) { - try { - log("pass: $pass"); - const Color backgroundColor = Colors.white; - const Color foregroundColor = Colors.black; - return QrImageView.withQr(qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, foregroundColor: foregroundColor); - } catch (e) { - return Text("Erro ao gerar QR Code: ${e.toString()}"); - } -} - - - // // Retorna o conteúdo a ser codificado no QR Code. - // String getContents() { - // return data; - // } - - // // Retorna uma versão do conteúdo otimizada para exibição. - // String getDisplayContents() { - // return data.trim(); - // } - - // // Retorna o título baseado no tipo de conteúdo. - // String getTitle() { - // return type; - // } - - // // Codifica o conteúdo em uma string adequada para o QR Code. - // Future encodeContents() async { - // // Implementação específica para codificar o conteúdo. - // return data; // Exemplo simplificado. - // } - - // // Codifica o conteúdo específico do QR Code. - // Future encodeQRCodeContents() async { - // return getQrCode(); - // } - - // // Gera o QR Code como um widget. - - - // // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). - // // Future encodeAsBitmap() async { - // // // Implementação para codificar como bitmap. - // // return Image(image); // Exemplo simplificado. - // // } - - // // Adivinha a codificação apropriada para o conteúdo. - // String guessAppropriateEncoding(String content) { - // // Implementação para adivinhar a codificação. - // return "UTF-8"; // Exemplo simplificado. - // } - - // // Remove espaços em branco do início e do fim do conteúdo. - // String trim(String content) { - // return content.trim(); - // } - - // // Escapa caracteres especiais para o formato MECARD. - // String escapeMECARD(String content) { - // // Implementação para escapar caracteres. - // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } - - /// menu - - Future scheduleVisitOptAction(BuildContext context) async { - await showAdaptiveDialog( - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'scheduleCompleteVisitPage', - 'scheduleProvisionalVisitPage', - 'fastPassPage', - ], - iconsListIcon: [ - Icons.date_range_rounded, - Icons.date_range_rounded, - Icons.date_range_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nCompleta', - enText: 'Complete\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nProvisória', - enText: 'Provisional\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nRápida', - enText: 'Fast\nSchedule', - ), - ], - ), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); - } - - Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future liberationHistoryOptAction(BuildContext context) async { - await showAdaptiveDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'liberationHistory', - 'acessHistoryPage', - 'scheduleCompleteVisitPage', - // 'messageHistoryPage', - ], - iconsListIcon: [ - Icons.history_rounded, - Icons.history_rounded, - Icons.history_rounded, - // Icons.history_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Liberação', - enText: 'Liberation\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Acesso', - enText: 'Access\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Visita', - enText: 'Visit\nHistory', - ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), - ], - ), - ); - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } diff --git a/lib/commons/components/atoms/menu_card_item/widget.dart b/lib/commons/components/atoms/menu_card_item/widget.dart deleted file mode 100644 index 5204dea7..00000000 --- a/lib/commons/components/atoms/menu_card_item/widget.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/widgets/custom_icons.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; - - - - -class MenuButtonWidget extends MenuEntry { - const MenuButtonWidget({ - Key? key, - this.action, - this.title, - this.icon, - }) : super(key: key); - - final Function()? action; - final String? title; - final IconData? icon; - - @override - _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); -} - -class _MenuButtonWidgetState extends State { - @override - Widget build(BuildContext context) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.action?.call(); - }, - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kfast, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - widget.title ?? 'Menu Item', - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - widget.icon, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/commons/components/molecules/menu_item/widget.dart b/lib/commons/components/molecules/menu_item/widget.dart deleted file mode 100644 index 458ff49a..00000000 --- a/lib/commons/components/molecules/menu_item/widget.dart +++ /dev/null @@ -1,11 +0,0 @@ - -import 'package:flutter/cupertino.dart'; - -abstract class MenuEntry extends StatefulWidget { - const MenuEntry({ - Key? key, - }) : super(key: key); - - - -} \ No newline at end of file diff --git a/lib/commons/components/molecules/menu_staggered_view/widget.dart b/lib/commons/components/molecules/menu_staggered_view/widget.dart deleted file mode 100644 index c635435b..00000000 --- a/lib/commons/components/molecules/menu_staggered_view/widget.dart +++ /dev/null @@ -1,1082 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:google_fonts/google_fonts.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; - -export 'model.dart'; - -class MenuStaggeredViewComponentWidget extends StatefulWidget { - const MenuStaggeredViewComponentWidget({ - super.key, - required this.changeMenuStyleAction, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, - }); - - final Future Function()? changeMenuStyleAction; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - - @override - State createState() => - _MenuStaggeredViewComponentWidgetState(); -} - -class _MenuStaggeredViewComponentWidgetState - extends State { - late MenuStaggeredViewComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuStaggeredViewComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.498, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: MasonryGridView.builder( - physics: const NeverScrollableScrollPhysics(), - gridDelegate: - const SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - ), - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - itemCount: 8, - padding: const EdgeInsets.fromLTRB( - 0, - 10.0, - 0, - 10.0, - ), - shrinkWrap: true, - itemBuilder: (context, index) { - return [ - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ee33l0ms' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ya37l3jt' /* Cadastrar - Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'h8s3adu8' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'j6tfixen' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9tli4i2x' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'i22hecs8' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Consult\nHistories', - ptText: 'Consultar\nHistóricos', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Preferences\nSettings', - ptText: 'Preferências\ndo Sistema', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - - ][index](); - }, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context).getVariableText( - enText: 'Minimize', - ptText: 'Minimizar', - ), - style: FlutterFlowTheme.of(context).title1.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 12.0, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.normal, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_up_sharp, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyleAction?.call(); - }, - ), - ), - ], - ), - ), - ), - ], - ); - } -} diff --git a/lib/commons/components/organisms/menu/widget.dart b/lib/commons/components/organisms/menu/widget.dart deleted file mode 100644 index ddda55dc..00000000 --- a/lib/commons/components/organisms/menu/widget.dart +++ /dev/null @@ -1,217 +0,0 @@ - - - - -import 'dart:developer'; - -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_list_view/widget.dart'; -import 'package:hub/commons/components/molecules/menu_staggered_view/widget.dart'; -import 'package:hub/commons/schema/enums/enums.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; - -class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({ - Key? key, - required this.style, - required this.item, - required this.expandable, - required this.options, - }); - final MenuView style; - final MenuItem item; - final bool expandable; - final List options; - - @override - State createState() => _MenuComponentWidgetState(); -} - -class _MenuComponentWidgetState extends State { - late MenuComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - log('MenuComponentWidget: ${widget.options.toList().toString()}'); - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Builder( - builder: (context) { - if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { - if (_model.isGrid == true) { - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - options: widget.options, - expandable: widget.expandable, - item: widget.item, - - - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } - } - if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - expandable: widget.expandable, - item: widget.item, - options: widget.options, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - - - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - - - ), - ); - } - return const SizedBox(); - }, - ), - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - -} diff --git a/lib/commons/components/templates/exception/widget.dart b/lib/commons/components/templates/exception/widget.dart deleted file mode 100644 index d1476ef0..00000000 --- a/lib/commons/components/templates/exception/widget.dart +++ /dev/null @@ -1,163 +0,0 @@ -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class ThrowExceptionWidget extends StatefulWidget { - const ThrowExceptionWidget({ - super.key, - required this.msg, - }); - - final String? msg; - - @override - State createState() => _ThrowExceptionWidgetState(); -} - -class _ThrowExceptionWidgetState extends State - with TickerProviderStateMixin { - late ThrowExceptionModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ThrowExceptionModel()); - - animationsMap.addAll({ - 'stackOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 600.0.ms, - begin: 0.0, - end: 1.0, - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Container( - height: 400.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(10.0), - bottomRight: Radius.circular(10.0), - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.circle_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.close_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, - ), - ), - ], - ).animateOnPageLoad( - animationsMap['stackOnPageLoadAnimation']!), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - 'e58xxxiq' /* ERRO */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Text( - valueOrDefault( - widget.msg, - 'Message Not Found', - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart(const SizedBox(height: 50.0)), - ), - ], - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/commons/schema/structs/index.dart b/lib/commons/schema/structs/index.dart deleted file mode 100644 index 18bd18f3..00000000 --- a/lib/commons/schema/structs/index.dart +++ /dev/null @@ -1,3 +0,0 @@ -export '/commons/schema/util/schema_util.dart'; - -export 'device_struct.dart'; diff --git a/lib/commons/components/atoms/menu_button_item/widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart similarity index 95% rename from lib/commons/components/atoms/menu_button_item/widget.dart rename to lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 83388793..fd0df4ca 100644 --- a/lib/commons/components/atoms/menu_button_item/widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/widgets/custom_icons.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:hub/commons/widgets/internationalization.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; @@ -23,9 +21,12 @@ class MenuButtonWidget extends MenuEntry { @override _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); + } class _MenuButtonWidgetState extends State { + get action => action; + @override Widget build(BuildContext context) { return InkWell( diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart new file mode 100644 index 00000000..ac553c46 --- /dev/null +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + + + +class MenuCardItem extends MenuEntry { + const MenuCardItem({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuCardItemState createState() => _MenuCardItemState(); + +} + +class _MenuCardItemState extends State { + get action => action; + + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Card( + elevation: 0, + color: FlutterFlowTheme.of(context).primaryBackground, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(8.0, 0.0, 10.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + widget.icon, + fill: null, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Text( + widget.title ?? '', + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier b/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/components/atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart similarity index 62% rename from lib/shared/components/atoms/atom_image_svg_theme.dart rename to lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart index 6da1479c..94484ab5 100644 --- a/lib/shared/components/atoms/atom_image_svg_theme.dart +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -1,13 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -class AtomImageSVGTheme extends StatelessWidget { - +class AtomImageSvgTheme extends StatelessWidget { final String filename; final double width; final double height; - const AtomImageSVGTheme({ + const AtomImageSvgTheme({ super.key, required this.filename, required this.width, @@ -18,12 +17,9 @@ class AtomImageSVGTheme extends StatelessWidget { Widget build(BuildContext context) { final brightness = MediaQuery.of(context).platformBrightness; final isDarkMode = brightness == Brightness.dark; - final pathImage = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; + final path = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; - return SvgPicture.asset( - pathImage, - width: width, - height: height, - ); + return SvgPicture.asset(path, width: width, height: height); } + } diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/io/textfield/model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart similarity index 81% rename from lib/commons/widgets/io/textfield/model.dart rename to lib/components/atomic_components/text_field_component/text_field_component_model.dart index a9b24925..a74572ce 100644 --- a/lib/commons/widgets/io/textfield/model.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_model.dart @@ -1,7 +1,8 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show TextFieldComponentWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import 'text_field_component_widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; + class TextFieldComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,4 +20,4 @@ class TextFieldComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/io/textfield/widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart similarity index 95% rename from lib/commons/widgets/io/textfield/widget.dart rename to lib/components/atomic_components/text_field_component/text_field_component_widget.dart index 0877f481..90a63614 100644 --- a/lib/commons/widgets/io/textfield/widget.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart @@ -1,9 +1,12 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'text_field_component_model.dart'; +export 'text_field_component_model.dart'; + +//// + class TextFieldComponentWidget extends StatefulWidget { const TextFieldComponentWidget({ @@ -114,4 +117,4 @@ class _TextFieldComponentWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart new file mode 100644 index 00000000..042a9353 --- /dev/null +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -0,0 +1,19 @@ + + +import 'package:flutter/material.dart'; + +abstract class MenuEntry extends StatefulWidget { + const MenuEntry({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + + +} \ No newline at end of file diff --git a/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier b/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/access_filter/model.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart similarity index 85% rename from lib/modals/filters/access_filter/model.dart rename to lib/components/molecular_components/message_opt_modal/opt_modal_model.dart index 4a3c32d4..0963fec9 100644 --- a/lib/modals/filters/access_filter/model.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart @@ -1,8 +1,9 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show OptModalWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +29,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/access_filter/widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart similarity index 96% rename from lib/modals/filters/access_filter/widget.dart rename to lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index d0dab29d..6b2df897 100644 --- a/lib/modals/filters/access_filter/widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -1,9 +1,12 @@ -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/modals/filters/options/model.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -62,9 +65,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -328,4 +331,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/options/model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart similarity index 85% rename from lib/modals/filters/options/model.dart rename to lib/components/molecular_components/opt_modal/opt_modal_model.dart index 4a3c32d4..66133fb1 100644 --- a/lib/modals/filters/options/model.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_model.dart @@ -1,8 +1,10 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show OptModalWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +30,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/options/widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart similarity index 97% rename from lib/modals/filters/options/widget.dart rename to lib/components/molecular_components/opt_modal/opt_modal_widget.dart index d0dab29d..b2394f52 100644 --- a/lib/modals/filters/options/widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,9 +1,10 @@ -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/modals/filters/options/model.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -62,9 +63,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -328,4 +329,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/selections/model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart similarity index 55% rename from lib/modals/filters/selections/model.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart index 10acb96b..38613124 100644 --- a/lib/modals/filters/selections/model.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart @@ -1,5 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show OptionSelectionModalWidget; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class OptionSelectionModalModel @@ -9,4 +11,4 @@ class OptionSelectionModalModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/selections/widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart similarity index 96% rename from lib/modals/filters/selections/widget.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index 74a8c39b..83093a34 100644 --- a/lib/modals/filters/selections/widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -1,13 +1,14 @@ // import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; +import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ @@ -216,4 +217,4 @@ class _OptionSelectionModalWidgetState extends State ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/exception/model.dart b/lib/components/molecular_components/throw_exception/throw_exception_model.dart similarity index 64% rename from lib/commons/components/templates/exception/model.dart rename to lib/components/molecular_components/throw_exception/throw_exception_model.dart index b157c56b..69ec5ec4 100644 --- a/lib/commons/components/templates/exception/model.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_model.dart @@ -1,11 +1,13 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ThrowExceptionWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import 'throw_exception_widget.dart' show ThrowExceptionWidget; import 'package:flutter/material.dart'; + + class ThrowExceptionModel extends FlutterFlowModel { @override void initState(BuildContext context) {} @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart new file mode 100644 index 00000000..9f037c96 --- /dev/null +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -0,0 +1,175 @@ +import 'package:hub/shared/enums/enum_throw_exception.dart'; + +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'throw_exception_model.dart'; +export 'throw_exception_model.dart'; + +class ThrowExceptionWidget extends StatefulWidget { + ThrowExceptionWidget( + {super.key, required this.msg, this.type = EnumThrowException.error}); + + final String? msg; + EnumThrowException type; + + @override + State createState() => _ThrowExceptionWidgetState(); +} + +class _ThrowExceptionWidgetState extends State + with TickerProviderStateMixin { + late ThrowExceptionModel _model; + + final animationsMap = {}; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ThrowExceptionModel()); + + animationsMap.addAll({ + 'stackOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 600.0.ms, + begin: 0.0, + end: 1.0, + ), + ], + ), + }); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + Color _getColorByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FlutterFlowTheme.of(context).error; + case EnumThrowException.warning: + return FlutterFlowTheme.of(context).warning; + case EnumThrowException.success: + return FlutterFlowTheme.of(context).success; + } + } + + IconData _getIconByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return Icons.cancel_outlined; + case EnumThrowException.warning: + return Icons.warning_amber_outlined; + case EnumThrowException.success: + return Icons.check_circle_outline; + } + } + + String _getTitleByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FFLocalizations.of(context) + .getVariableText(ptText: "Falha :(", enText: "Fail :("); + case EnumThrowException.warning: + return FFLocalizations.of(context) + .getVariableText(ptText: "Aviso :O", enText: "Warning :O"); + case EnumThrowException.success: + return FFLocalizations.of(context) + .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); + ; + } + } + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Icon( + _getIconByType(context), + color: _getColorByType(context), + size: 150.0, + ), + ), + ], + ).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + _getTitleByType(context), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Text( + valueOrDefault( + widget.msg, + 'Message Not Found', + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ].addToStart(const SizedBox(height: 20.0)), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/exceptions/not_found/model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart similarity index 55% rename from lib/modals/exceptions/not_found/model.dart rename to lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart index 3c858af5..6827c26d 100644 --- a/lib/modals/exceptions/not_found/model.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitorNotFoundComponentWidget; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorNotFoundComponentModel @@ -10,4 +11,4 @@ class VisitorNotFoundComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart new file mode 100644 index 00000000..9ffcdc37 --- /dev/null +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -0,0 +1,179 @@ +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; + +class VisitorNotFoundComponentWidget extends StatefulWidget { + const VisitorNotFoundComponentWidget({super.key}); + + @override + State createState() => + _VisitorNotFoundComponentWidgetState(); +} + +class _VisitorNotFoundComponentWidgetState + extends State { + late VisitorNotFoundComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => VisitorNotFoundComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.4, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + ), + Icon( + Icons.notifications_none, + color: FlutterFlowTheme.of(context).accent1, + size: 72.0, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '1p9mykbj' /* Usuário não encontrado */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: + FlutterFlowTheme.of(context).headlineMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'kt937sp6' /* O documento inserido não corre... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontStyle: FontStyle.italic, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + ), + ), + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: FFButtonWidget( + onPressed: () async { + Navigator.pop(context); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: true, + useSafeArea: true, + isDismissible: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), + options: FFButtonOptions( + width: double.infinity, + height: 30.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/top_arrow_linked_locals/model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart similarity index 55% rename from lib/modals/selection/top_arrow_linked_locals/model.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart index 291447c3..ebbcaea4 100644 --- a/lib/modals/selection/top_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart'; + +import '../../../flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class ArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class ArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/top_arrow_linked_locals/widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart similarity index 81% rename from lib/modals/selection/top_arrow_linked_locals/widget.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart index 9bbe184c..d0a00a4f 100644 --- a/lib/modals/selection/top_arrow_linked_locals/widget.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + class ArrowLinkedLocalsComponentWidget extends StatefulWidget { const ArrowLinkedLocalsComponentWidget({super.key}); @@ -38,4 +38,4 @@ class _ArrowLinkedLocalsComponentWidgetState Widget build(BuildContext context) { return Container(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/bottom_arrow_linked_locals/model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart similarity index 54% rename from lib/modals/selection/bottom_arrow_linked_locals/model.dart rename to lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart index 6e37e7bd..3ff8aba1 100644 --- a/lib/modals/selection/bottom_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show BottomArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class BottomArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class BottomArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart new file mode 100644 index 00000000..b1ece369 --- /dev/null +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -0,0 +1,293 @@ +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:provider/provider.dart'; + + +class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { + const BottomArrowLinkedLocalsComponentWidget({super.key}); + + @override + State createState() => + _BottomArrowLinkedLocalsComponentWidgetState(); +} + +class _BottomArrowLinkedLocalsComponentWidgetState + extends State { + late BottomArrowLinkedLocalsComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => BottomArrowLinkedLocalsComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 150.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 150.0, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).accent1, + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + Expanded( + child: FutureBuilder( + future: PhpGroup.getLocalsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final gridViewGetLocalsResponse = snapshot.data!; + + return Builder( + builder: (context) { + final eachLocals = PhpGroup.getLocalsCall + .locais( + gridViewGetLocalsResponse.jsonBody, + ) + ?.map((e) => e) + .toList() + .toList() ?? + []; + + return GridView.builder( + padding: EdgeInsets.zero, + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, + crossAxisSpacing: 10.0, + mainAxisSpacing: 0.0, + childAspectRatio: 1.0, + ), + scrollDirection: Axis.horizontal, + itemCount: eachLocals.length, + itemBuilder: (context, eachLocalsIndex) { + final eachLocalsItem = + eachLocals[eachLocalsIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + FFAppState().cliUUID = getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString(); + setState(() {}); + FFAppState().local = getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(); + setState(() {}); + FFAppState().ownerUUID = getJsonField( + eachLocalsItem, + r'''$.CLU_OWNER_ID''', + ).toString(); + setState(() {}); + Navigator.pop(context); + }, + child: Container( + width: 50.0, + height: double.infinity, + decoration: const BoxDecoration(), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryText, + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + border: Border.all( + color: FlutterFlowTheme.of( + context) + .secondaryText, + width: 3.0, + ), + ), + child: ClipRRect( + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + child: Image.network( + 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString()}.png', + width: double.infinity, + height: double.infinity, + fit: BoxFit.fill, + alignment: + const Alignment(0.0, 0.0), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Text( + getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ], + ), + ), + ); + }, + ); + }, + ); + }, + ), + ), + ].addToStart(const SizedBox(width: 20.0)), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/local_header/model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart similarity index 62% rename from lib/commons/components/atoms/local_header/model.dart rename to lib/components/organism_components/local_profile_component/local_profile_component_model.dart index befb297d..12c50d2f 100644 --- a/lib/commons/components/atoms/local_header/model.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart @@ -1,8 +1,9 @@ -import 'package:hub/commons/components/atoms/local_header/widget.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; import 'package:flutter/material.dart'; +/// + class LocalProfileComponentModel extends FlutterFlowModel { @override @@ -10,4 +11,4 @@ class LocalProfileComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/local_header/widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart similarity index 92% rename from lib/commons/components/atoms/local_header/widget.dart rename to lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index 047ae944..ab338b78 100644 --- a/lib/commons/components/atoms/local_header/widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,16 +1,15 @@ - -import 'package:hub/commons/components/atoms/local_header/model.dart'; -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/random_data_util.dart' as random_data; +import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'model.dart'; +import 'local_profile_component_model.dart'; +export 'local_profile_component_model.dart'; + +//// class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({ @@ -149,4 +148,4 @@ class _LocalProfileComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/organisms/menu/model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart similarity index 91% rename from lib/commons/components/organisms/menu/model.dart rename to lib/components/organism_components/menu_component/menu_component_model.dart index ad111216..b2842e56 100644 --- a/lib/commons/components/organisms/menu/model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:hub/commons/components/molecules/menu_list_view/model.dart'; -import 'package:hub/commons/components/molecules/menu_staggered_view/model.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; +import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_component_widget.dart' show MenuComponentWidget; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show MenuComponentWidget; class MenuComponentModel extends FlutterFlowModel { /// Local state fields for this component. @@ -189,4 +189,4 @@ class MenuComponentModel extends FlutterFlowModel { } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart new file mode 100644 index 00000000..5839264c --- /dev/null +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -0,0 +1,165 @@ +import 'dart:developer'; + +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'menu_component_model.dart'; +export 'menu_component_model.dart'; + + +class MenuComponentWidget extends StatefulWidget { + const MenuComponentWidget({ + Key? key, + required this.style, + required this.item, + required this.expandable, + }); + final MenuView style; + final MenuItem item; + final bool expandable; + @override + State createState() => _MenuComponentWidgetState(); +} + +class _MenuComponentWidgetState extends State { + late MenuComponentModel _model; + + + + @override + void setState(VoidCallback callback) { + + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuComponentModel()); + + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final options = widget.item == MenuItem.button + ? [ + MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),), + + MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),), + + // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), + // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),), + + MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),), + + MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),), + + MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),), + ] : [ + MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),), + + MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),), + + // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), + // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),), + + MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),), + + MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),), + + MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),), + + ]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Builder( + builder: (context) { + if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } + } + if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } + return const SizedBox(); + }, + ), + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_list_view/model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart similarity index 63% rename from lib/commons/components/molecules/menu_list_view/model.dart rename to lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart index 945dd425..027278ab 100644 --- a/lib/commons/components/molecules/menu_list_view/model.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart @@ -1,8 +1,8 @@ - -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; import 'package:flutter/material.dart'; -import 'widget.dart'; + class MenuListViewComponentModel extends FlutterFlowModel { @@ -11,4 +11,4 @@ class MenuListViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_list_view/widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart similarity index 63% rename from lib/commons/components/molecules/menu_list_view/widget.dart rename to lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index 481e0fbb..1a2cac35 100644 --- a/lib/commons/components/molecules/menu_list_view/widget.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -1,30 +1,26 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/schema/enums/enums.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_list_view_component_model.dart'; + +export 'menu_list_view_component_model.dart'; + +/// class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, required this.changeMenuStyle, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, + required this.expandable, required this.item, required this.options, - required this.messageHistoryAction, }); final bool expandable; @@ -32,13 +28,6 @@ class MenuListViewComponentWidget extends StatefulWidget { final List options; final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - final Future Function()? messageHistoryAction; @override State createState() => @@ -95,37 +84,43 @@ class _MenuListViewComponentWidgetState width: double.infinity, child: ListView.builder( addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, + padding: const EdgeInsets.symmetric(horizontal: 15), shrinkWrap: true, physics: const AlwaysScrollableScrollPhysics(), scrollDirection: Axis.horizontal, - itemCount: widget.options.length, itemBuilder: (context, index) { - return SizedBox( - height: 115, - width: 115, - child: widget.options[index]); + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); }, ), ); case MenuItem.card: - return ListView.builder( - addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: const AlwaysScrollableScrollPhysics(), - itemCount: widget.options.length, - itemBuilder: (context, index) { - return MenuButtonWidget( - action: widget.registerVisitorOptAction, - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', + return SizedBox( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.8, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: const EdgeInsets.symmetric(horizontal: 15), + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + itemCount: widget.options.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); + }, ), - icon: Icons.person_add_alt_1_outlined, - ); - }, ); } } @@ -170,3 +165,4 @@ class _MenuListViewComponentWidgetState ); } } + diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_staggered_view/model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart similarity index 57% rename from lib/commons/components/molecules/menu_staggered_view/model.dart rename to lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart index 4124e85c..4ee29584 100644 --- a/lib/commons/components/molecules/menu_staggered_view/model.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart @@ -1,9 +1,9 @@ +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'widget.dart'; class MenuStaggeredViewComponentModel extends FlutterFlowModel { @@ -12,4 +12,4 @@ class MenuStaggeredViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart new file mode 100644 index 00000000..0b4f3c6b --- /dev/null +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -0,0 +1,157 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/custom_icons.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + +class MenuStaggeredViewComponentWidget extends StatefulWidget { + const MenuStaggeredViewComponentWidget({ + super.key, + required this.changeMenuStyle, + required this.expandable, + required this.item, + required this.options, + }); + + final bool expandable; + final MenuItem item; + + final List options; + final Future Function()? changeMenuStyle; + + @override + State createState() => + _MenuStaggeredViewComponentWidgetState(); +} + +class _MenuStaggeredViewComponentWidgetState + extends State { + late MenuStaggeredViewComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuStaggeredViewComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.498, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: MasonryGridView.builder( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: + const SliverSimpleGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + ), + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + itemCount: widget.options.length, + padding: const EdgeInsets.fromLTRB( + 0, + 10.0, + 0, + 10.0, + ), + shrinkWrap: true, + itemBuilder: (context, index) { + return SizedBox( + height: 100, + width: 100, + child: widget.options[index]); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context).getVariableText( + enText: 'Minimize', + ptText: 'Minimizar', + ), + style: FlutterFlowTheme.of(context).title1.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 12.0, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_up_sharp, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ), + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/message_well/model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart similarity index 81% rename from lib/commons/components/molecules/message_well/model.dart rename to lib/components/organism_components/message_well_component/message_well_component_model.dart index 3a1c4b48..e6b577de 100644 --- a/lib/commons/components/molecules/message_well/model.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_model.dart @@ -1,10 +1,15 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + +import '/flutter_flow/flutter_flow_util.dart'; +import 'message_well_component_widget.dart' show MessageWellComponentWidget; +import 'package:flutter/material.dart'; + +/// + import 'package:flutter/material.dart'; -import 'widget.dart'; class MessageWellComponentModel extends FlutterFlowModel { @@ -44,4 +49,4 @@ class MessageWellComponentModel clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/message_well/widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart similarity index 98% rename from lib/commons/components/molecules/message_well/widget.dart rename to lib/components/organism_components/message_well_component/message_well_component_widget.dart index 680f89cf..29432952 100644 --- a/lib/commons/components/molecules/message_well/widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,16 +2,19 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; +// + + final dropdown = BehaviorSubject>.seeded( LinkedHashMap.from({ 'All': 'A', @@ -340,4 +343,4 @@ class MessageWellNotifier extends StateNotifier { final messageWellProvider = StateNotifierProvider((ref) { return MessageWellNotifier(); -}); +}); \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/schedule_visit_detail/model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart similarity index 60% rename from lib/modals/details/schedule_visit_detail/model.dart rename to lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index 53c511e1..d4df4084 100644 --- a/lib/modals/details/schedule_visit_detail/model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,8 +1,11 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'dart:developer'; + +import 'package:hub/backend/api_requests/api_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ScheduleVisitDetailWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:intl/intl.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -35,6 +38,36 @@ class ScheduleVisitDetailModel // Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget. ApiCallResponse? postScheduleVisit; + String convertDateFormat(String dateStr) { + try { + log('Received date string: $dateStr'); + + // Formato original + DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + // Novo formato + DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); + + // Validate the input string format + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { + log('Invalid date format: $dateStr'); + return 'Invalid date format'; + } + + // Converte a string para DateTime + DateTime dateTime = originalFormat.parse(dateStr); + + // Converte DateTime para a nova string formatada + String formattedDate = newFormat.format(dateTime); + log('Formatted date: $formattedDate'); + return formattedDate; + } catch (e) { + // Handle the exception by returning an error message or a default value + log('Error parsing date: $e'); + return 'Invalid date format'; + } + } + @override void initState(BuildContext context) {} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart new file mode 100644 index 00000000..150dd715 --- /dev/null +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -0,0 +1,845 @@ +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.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:provider/provider.dart'; + +class ScheduleVisitDetailWidget extends StatefulWidget { + const ScheduleVisitDetailWidget({ + super.key, + required this.visitorJsonList, + required this.visitorStrList, + this.visitorImgPath, + required this.visitStartDate, + required this.visitEndDate, + required this.visitResonStr, + required this.visitLevelStr, + required this.visitTempStr, + required this.visitObsStr, + }); + + final List? visitorJsonList; + final String? visitorStrList; + final String? visitorImgPath; + final String? visitStartDate; + final String? visitEndDate; + final String? visitResonStr; + final String? visitLevelStr; + final String? visitTempStr; + final String? visitObsStr; + + @override + State createState() => + _ScheduleVisitDetailWidgetState(); +} + +class _ScheduleVisitDetailWidgetState extends State { + late ScheduleVisitDetailModel _model; + late FocusNode _focusNode; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _focusNode = FocusNode(); + _model = createModel(context, () => ScheduleVisitDetailModel()); + + _model.textController1 ??= TextEditingController(text: widget.visitTempStr); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= + TextEditingController(text: widget.visitStartDate); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); + _model.textFieldFocusNode3 ??= FocusNode(); + + _model.textController4 ??= + TextEditingController(text: extractDescToStr(widget.visitResonStr!)); + _model.textFieldFocusNode4 ??= FocusNode(); + + _model.textController5 ??= + TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); + _model.textFieldFocusNode5 ??= FocusNode(); + + _model.textController6 ??= TextEditingController(text: widget.visitObsStr); + _model.textFieldFocusNode6 ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + _focusNode.dispose(); + + super.dispose(); + } + + void _requestFocus() { + if (mounted) { + _focusNode.requestFocus(); + } + } + + @override + Widget build(BuildContext context) { + context.watch(); + final visitorsData = widget.visitorJsonList!.toList().take(2).toList(); + final visitorsDataItem = visitorsData[0]; + + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + child: GestureDetector( + onTap: () { + _requestFocus(); + }, + child: Container( + // color: FlutterFlowTheme.of(context).primaryBackground, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.6, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: double.infinity, + height: 35.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Visibility( + visible: widget.visitorStrList != null && + widget.visitorStrList != '', + child: Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.keyboard_return, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 20.0), + child: SizedBox( + width: 100.0, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorsDataItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 10.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '7w4fohoa' /* Encerramento da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController1Validator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context) + .getVariableText( + enText: 'Start', + ptText: 'Início', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '0cp1e31d' /* dd/mm/yyyy */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'abppdgz3' /* Término */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + 'kqralft4' /* dd/mm/yyyy */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'xjxhzqqm' /* Motivo da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '47oezdm6' /* Motivo */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + '2ujg7u18' /* Nível de Acesso */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '3emmbbfv' /* Nível de Acesso */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController5Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController6, + focusNode: _model.textFieldFocusNode6, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'ritce5uw' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController6Validator + .asValidator(context), + ), + ), + ), + ], + ), + ].divide(const SizedBox(height: 0.0)), + ), + IconButton( + onPressed: () async { + _model.postScheduleVisit = + await PhpGroup.postScheduleVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + atividade: 'putVisita', + devDesc: widget.visitObsStr, + idVisitante: widget.visitorStrList, + dtInicio: + _model.convertDateFormat(widget.visitStartDate ?? ''), + dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''), + unica: widget.visitTempStr, + idMotivo: extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), + obs: widget.visitObsStr, + cliID: FFAppState().cliUUID, + ); + + if (PhpGroup.postScheduleVisitCall.error( + (_model.postScheduleVisit?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitCall.errorMsg( + (_model.postScheduleVisit?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + icon: Icon( + Icons.check, + color: FlutterFlowTheme.of(context).primary, + size: 15.0, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/up_arrow_linked_locals/model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart similarity index 54% rename from lib/modals/selection/up_arrow_linked_locals/model.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart index 6139bceb..54f840ca 100644 --- a/lib/modals/selection/up_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show UpArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class UpArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class UpArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/up_arrow_linked_locals/widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart similarity index 96% rename from lib/modals/selection/up_arrow_linked_locals/widget.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index cdd3fb04..968b22f9 100644 --- a/lib/modals/selection/up_arrow_linked_locals/widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -1,14 +1,16 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); @@ -242,4 +244,4 @@ class _UpArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/access_notification/model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart similarity index 92% rename from lib/modals/notifications/access_notification/model.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart index 98a0cbf6..f9ee4e21 100644 --- a/lib/modals/notifications/access_notification/model.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart @@ -1,11 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; + class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/access_notification/widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart similarity index 98% rename from lib/modals/notifications/access_notification/widget.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart index 8c4018e8..a8d77589 100644 --- a/lib/modals/notifications/access_notification/widget.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -1,11 +1,14 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'access_notification_modal_template_component_model.dart'; +export 'access_notification_modal_template_component_model.dart'; + + + class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { const AccessNotificationModalTemplateComponentWidget({ @@ -380,4 +383,4 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/card/model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart similarity index 62% rename from lib/commons/components/molecules/card/model.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart index 43508738..032a1f68 100644 --- a/lib/commons/components/molecules/card/model.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart @@ -1,7 +1,8 @@ -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'card_item_template_component_widget.dart' + show CardItemTemplateComponentWidget; import 'package:flutter/material.dart'; -import 'widget.dart'; class CardItemTemplateComponentModel extends FlutterFlowModel { @@ -10,4 +11,4 @@ class CardItemTemplateComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/card/widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart similarity index 98% rename from lib/commons/components/molecules/card/widget.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 1452e832..a1e4cfc6 100644 --- a/lib/commons/components/molecules/card/widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -1,15 +1,18 @@ import 'dart:collection'; import 'dart:developer'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; +import 'card_item_template_component_model.dart'; +export 'card_item_template_component_model.dart'; + +/// + -import 'model.dart'; -export 'model.dart'; class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ @@ -242,4 +245,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/change_password/model.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart similarity index 95% rename from lib/modals/forms/change_password/model.dart rename to lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart index 924ec401..25cc4529 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart @@ -1,8 +1,9 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'change_pass_widget.dart' show PassKeyTemplateWidget; import 'package:flutter/material.dart'; + class PassKeyTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -47,4 +48,4 @@ class PassKeyTemplateComponentModel keyTextFieldTextController1?.dispose(); keyTextFieldTextController2?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/change_password/widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart similarity index 98% rename from lib/modals/forms/change_password/widget.dart rename to lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart index ccecaa4c..02ae2c83 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart @@ -1,12 +1,15 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'change_pass_model.dart'; +export 'change_pass_model.dart'; + class PassKeyTemplateWidget extends StatefulWidget { const PassKeyTemplateWidget({ @@ -341,4 +344,4 @@ class _PassKeyTemplateWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart new file mode 100644 index 00000000..13c3c56a --- /dev/null +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -0,0 +1,47 @@ +import 'package:hub/shared/utils/validator_util.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'forgot_password_template_component_widget.dart' + show ForgotPasswordTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class ForgotPasswordTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3hqg8buh' /* E-mail é Obrigatório */, + ); + } + + if (!ValidatorUtil.isValidEmail(val)) { + return FFLocalizations.of(context).getText( + 'jh5r2b1w' /* E-mail Inválido */, + ); + } + return null; + } + + // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. + ApiCallResponse? req; + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + } +} \ No newline at end of file diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart new file mode 100644 index 00000000..443b4b65 --- /dev/null +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -0,0 +1,317 @@ +import 'dart:developer'; + +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'forgot_password_template_component_model.dart'; +export 'forgot_password_template_component_model.dart'; + +class ForgotPasswordTemplateComponentWidget extends StatefulWidget { + const ForgotPasswordTemplateComponentWidget({super.key}); + + @override + State createState() => + _ForgotPasswordTemplateComponentWidgetState(); +} + +class _ForgotPasswordTemplateComponentWidgetState + extends State { + late ForgotPasswordTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ForgotPasswordTemplateComponentModel()); + + _model.emailAddressTextController ??= TextEditingController(); + _model.emailAddressFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 300.0, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + ), + ), + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + onChanged: (_) => EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'mtz8l7ft' /* E-mail */, + ), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.black, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.emailAddressTextControllerValidator + .asValidator(context), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) + ? null + : () async { + + try { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); + + if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) { + await DialogUtil.success(context, FFLocalizations.of(context).getVariableText( + enText: "Send E-mail Successful!", + ptText: "E-mail Enviado com Sucesso!" + )); + Navigator.pop(context); + } else { + await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!); + } + + setState(() {}); + + } catch (error, stack) { + LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack); + await DialogUtil.errorDefault(context); + } + }, + text: FFLocalizations.of(context).getText( + '74rnd5bu' /* Enviar */, + ), + options: FFButtonOptions( + width: 270.0, + height: 50.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: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: 16.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, + ), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, + ), + showLoadingIndicator: true, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/liberation_history_item_details/model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart similarity index 85% rename from lib/modals/details/liberation_history_item_details/model.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart index a53352d9..6612b45a 100644 --- a/lib/modals/details/liberation_history_item_details/model.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart @@ -1,9 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show LiberationHistoryItemDetailsTemplateComponentWidget; import 'package:flutter/material.dart'; class LiberationHistoryItemDetailsTemplateComponentModel @@ -77,4 +78,4 @@ class LiberationHistoryItemDetailsTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/liberation_history_item_details/widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart similarity index 97% rename from lib/modals/details/liberation_history_item_details/widget.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart index 0c9b872f..025df6e5 100644 --- a/lib/modals/details/liberation_history_item_details/widget.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart @@ -1,11 +1,13 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { @@ -363,4 +365,4 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/message_notificaion/model.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart similarity index 86% rename from lib/modals/notifications/message_notificaion/model.dart rename to lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart index b4dc9501..0bcc4038 100644 --- a/lib/modals/notifications/message_notificaion/model.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart @@ -1,10 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show MessageNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class MessageNotificationModalTemplateComponentModel extends FlutterFlowModel { @@ -76,4 +76,4 @@ class MessageNotificationModalTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/message_notificaion/widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart similarity index 96% rename from lib/modals/notifications/message_notificaion/widget.dart rename to lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 713eebc5..964a9cd7 100644 --- a/lib/modals/notifications/message_notificaion/widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -1,10 +1,15 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ @@ -285,4 +290,4 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/qr_code/model.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart similarity index 92% rename from lib/modals/forms/qr_code/model.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart index 813a6c2a..da0ca0a5 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart @@ -1,5 +1,5 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'qr_code_pass_key_template_component_widget.dart' show QrCodePassKeyTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart similarity index 97% rename from lib/modals/forms/qr_code/widget.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index 8f31f358..9fcaa067 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -1,12 +1,17 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'qr_code_pass_key_template_component_model.dart'; +export 'qr_code_pass_key_template_component_model.dart'; + + + class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ @@ -326,4 +331,4 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart new file mode 100644 index 00000000..6e812792 --- /dev/null +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -0,0 +1,149 @@ +import 'dart:developer'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'package:flutter/material.dart'; + +import 'regisiter_vistor_template_component_widget.dart'; + +class RegisiterVistorTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + bool isDataUploading = false; + FFUploadedFile uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + Future getVisitanteByDocument( + String document, BuildContext context) async { + final response = await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: document, + ); + log('${response.jsonBody}'); + if (response.jsonBody['visitante']['VTE_ID'] != '0' && + response.jsonBody['error'] != 'false') { + return true; + } + return null; + } + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + // State field(s) for DropDown widget. + String? dropDownValue; + FormFieldController? dropDownValueController; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode4; + TextEditingController? textController4; + String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + if (!val.contains('@') || !val.contains('.')) { + return FFLocalizations.of(context).getVariableText( + enText: 'Invalid email', + ptText: 'Email inválido', + ); + } + return null; + } + + // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. + String? imgBase64; + // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. + ApiCallResponse? scheduleVisitor; + + @override + void initState(BuildContext context) { + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } + + @override + void dispose() { + unfocusNode.dispose(); + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + textFieldFocusNode4?.dispose(); + textController4?.dispose(); + } +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/registers/visitor/component.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart similarity index 56% rename from lib/pages/registers/visitor/component.dart rename to lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 894aa28c..9e187e31 100644 --- a/lib/pages/registers/visitor/component.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,75 +1,31 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'dart:developer'; -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/upload_data.dart'; -import '/commons/actions/index.dart' as actions; +import 'package:flutter/services.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:json_path/fun_sdk.dart'; +import 'package:rxdart/rxdart.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_drop_down.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/flutter_flow/form_field_controller.dart'; +import '/flutter_flow/upload_data.dart'; +import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'component.dart'; - - - -class RegisiterVistorTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? registerVisitor; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} +import 'regisiter_vistor_template_component_model.dart'; +export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { - const RegisiterVistorTemplateComponentWidget({super.key}); + final String source; + + const RegisiterVistorTemplateComponentWidget( + {super.key, required this.source}); @override State createState() => @@ -80,11 +36,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State { late RegisiterVistorTemplateComponentModel _model; - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } + final scaffoldKey = GlobalKey(); @override void initState() { @@ -97,6 +49,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); + _model.textController2?.addListener(_onTextChanged); _model.textController3 ??= TextEditingController(); _model.textFieldFocusNode3 ??= FocusNode(); @@ -107,18 +60,29 @@ class _RegisiterVistorTemplateComponentWidgetState @override void dispose() { - _model.maybeDispose(); + _model.dispose(); super.dispose(); + _model.textController2?.removeListener(_onTextChanged); + } + + void _onTextChanged() { + log('changed'); + setState(() {}); } @override Widget build(BuildContext context) { + BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); - + log(context + .describeWidget('RegisiterVistorTemplateComponentWidget') + .toString()); return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( + width: double.infinity, + height: double.infinity, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -128,194 +92,22 @@ class _RegisiterVistorTemplateComponentWidgetState topRight: Radius.circular(25.0), ), ), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 30.0, 0.0, 0.0), - child: SingleChildScrollView( + child: SingleChildScrollView( + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 20.0), - child: Text( - FFLocalizations.of(context).getText( - 'wnhkedzt' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w800, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ), - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState(() => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: - m.storagePath.split('/').last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kpd31z4d' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'q986vs4m' /* Preencha o formulário com os d... */, + 'zazj5d8b' /* Preencha o formulário com os d... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -329,16 +121,150 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: + _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + FutureBuilder( + future: _model.textController2.text.isNotEmpty + ? _model.getVisitanteByDocument( + _model.textController2.text, context) + : null, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const SizedBox(); + } else if (snapshot.hasError || + snapshot.data == null || + snapshot.data == '') { + visitorAlreadyRegistered.add(true); + return const SizedBox(); + } else { + visitorAlreadyRegistered.add(false); + return _model.textController2.text.isEmpty + ? const SizedBox() + : Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + right: MediaQuery.sizeOf(context).width * + 0.1), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .error, + fontSize: 14.0, + letterSpacing: 0.0, + )), + ), + ], + ); + } + }, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, focusNode: _model.textFieldFocusNode1, autofocus: false, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'llcw2tei' /* Nome */, + 'v7g73yik' /* Nome */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -362,7 +288,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -407,178 +333,284 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController1Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, decoration: const BoxDecoration(), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '67ykbznt' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 20.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( FFLocalizations.of(context).getText( - 'ugjkeiz7' /* Visitante */, + 'yp23q90m' /* Selecione o tipo: */, ), - FFLocalizations.of(context).getText( - '8nlk5xlk' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 48.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'kw07i43y' /* Selecione... */, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).accent1, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 4.0, 16.0, 4.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), ), - ], - ), + ], ), ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - labelText: FFLocalizations.of(context).getText( - '96ayre48' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + Builder( + builder: (context) { + if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + setState(() { + _model.isDataUploading = false; + _model.uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.memory( + _model.uploadedLocalFile.bytes ?? + Uint8List.fromList([]), + width: 300.0, + height: 200.0, + fit: BoxFit.cover, ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + ), + ); + } else { + return Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: FFButtonWidget( + onPressed: () async { + final selectedMedia = + await selectMediaWithSourceBottomSheet( + context: context, + // maxWidth: 300.00, + // maxHeight: 300.00, + imageQuality: 100, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null && + selectedMedia.every((m) => + validateFileFormat( + m.storagePath, context))) { + setState(() => _model.isDataUploading = true); + var selectedUploadedFiles = + []; + + try { + showUploadMessage( + context, + 'Uploading file...', + showLoading: true, + ); + selectedUploadedFiles = selectedMedia + .map((m) => FFUploadedFile( + name: + m.storagePath.split('/').last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + // blurHash: m.blurHash, + )) + .toList(); + } finally { + ScaffoldMessenger.of(context) + .hideCurrentSnackBar(); + _model.isDataUploading = false; + } + if (selectedUploadedFiles.length == + selectedMedia.length) { + setState(() { + _model.uploadedLocalFile = + selectedUploadedFiles.first; + }); + showUploadMessage(context, 'Success!'); + } else { + setState(() {}); + showUploadMessage( + context, 'Failed to upload data'); + return; + } + } + }, + text: '', + icon: Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context).accent1, + size: 30.0, + ), + options: FFButtonOptions( + width: 300.0, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.2, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController2Validator.asValidator(context), - ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy' /* Clique para adicionar a foto p... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ); + } + }, ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 10.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'j0g7ggs2' /* Contatos */, + 'bqpucwh0' /* Contatos */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -592,16 +624,24 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.next, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[0-9, +, -, (, )]')), + ], obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'ybdjabnd' /* Telefone */, + 'h84ls2r6' /* Telefone */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -625,7 +665,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -664,21 +704,24 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), - validator: - _model.textController3Validator.asValidator(context), + // validator: + // _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsets.all(24.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.done, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'tlr6uxo4' /* Email */, + 'fqp7qmka' /* Email */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -702,7 +745,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -742,131 +785,169 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), keyboardType: TextInputType.emailAddress, - validator: - _model.textController4Validator.asValidator(context), + // validator: + // _model.textController4Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && (_model.textController1.text != '') && (_model.dropDownValue != null && _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.registerVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: (_model.dropDownValue == 'Visitante') || - (_model.dropDownValue == 'Visitor') - ? 'V' - : 'P', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.registerVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.registerVisitor?.jsonBody ?? ''), - )}', - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), + (_model.textController2.text != '')) + ? () async { + log(visitorAlreadyRegistered.value.toString()); + if (visitorAlreadyRegistered.value == true) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '65puvap9' /* Cadastrar */, + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context) + .info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + width: MediaQuery.of(context).size.width, + behavior: SnackBarBehavior.floating, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + ), + ); + if (widget.source == + 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + return DialogUtil.error( + context, + PhpGroup.postScheduleVisitorCall + .errorMsg( + _model.scheduleVisitor?.jsonBody) + .toString()); + } + } else { + DialogUtil.error( + context, + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.', + enText: + 'Visitor already registered. Check if the document was filled in correctly.', + )); + } + } + : null, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, + ), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + disabledColor: FlutterFlowTheme.of(context).customColor5, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, ), - options: FFButtonOptions( - width: double.infinity, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)) + .addToEnd(const SizedBox(height: 30.0)), ), ), ), diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart new file mode 100644 index 00000000..e1010ec7 --- /dev/null +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -0,0 +1,62 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_in_template_component_widget.dart' + show SignInTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignInTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + final unfocusNode = FocusNode(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'xhnawzcb' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 's3j1hjqx' /* E-mail Inv */, + ); + } + return null; + } + + // State field(s) for password widget. + FocusNode? passwordFocusNode; + TextEditingController? passwordTextController; + late bool passwordVisibility; + String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9cs5wlmc' /* Campo é necessário */, + ); + } + + return null; + } + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + + passwordFocusNode?.dispose(); + passwordTextController?.dispose(); + } +} diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signin/component.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart similarity index 82% rename from lib/pages/onboarding/signin/component.dart rename to lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index 4009a680..94ee24dc 100644 --- a/lib/pages/onboarding/signin/component.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -1,74 +1,22 @@ -import 'package:hub/modals/forms/forgot_password/widget.dart'; -import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; -export 'component.dart'; - - - -class SignInTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - String? _emailAddressTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'xhnawzcb' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - String? _passwordTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '9cs5wlmc' /* Campo é necessário */, - ); - } - - return null; - } - - @override - void initState(BuildContext context) { - emailAddressTextControllerValidator = _emailAddressTextControllerValidator; - passwordVisibility = false; - passwordTextControllerValidator = _passwordTextControllerValidator; - } - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); - } -} - +import 'sign_in_template_component_model.dart'; +export 'sign_in_template_component_model.dart'; class SignInTemplateComponentWidget extends StatefulWidget { const SignInTemplateComponentWidget({ @@ -151,6 +99,18 @@ class _SignInTemplateComponentWidgetState super.dispose(); } + bool _isFormInvalid() { + if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') { + return true; + } + + if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) { + return true; + } + + return false; + } + @override Widget build(BuildContext context) { return Row( @@ -171,8 +131,8 @@ class _SignInTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 35.0, 0.0, 35.0), child: Container( width: 548.0, height: 112.0, @@ -188,7 +148,8 @@ class _SignInTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: + const AlignmentDirectional(0.0, 1.0), child: Padding( padding: const EdgeInsets.all(3.0), child: Text( @@ -224,7 +185,7 @@ class _SignInTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: const AtomImageSVGTheme(filename: 'login', width: 600, height: 155), + child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155), ), ), Column( @@ -263,8 +224,9 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -273,7 +235,17 @@ class _SignInTemplateComponentWidgetState .emailAddressTextController, focusNode: _model .emailAddressFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration( + milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], textCapitalization: TextCapitalization.none, textInputAction: @@ -395,8 +367,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -405,7 +378,17 @@ class _SignInTemplateComponentWidgetState .passwordTextController, focusNode: _model.passwordFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration( + milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.password + ], textInputAction: TextInputAction.send, obscureText: !_model @@ -452,7 +435,8 @@ class _SignInTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -463,7 +447,8 @@ class _SignInTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -474,7 +459,8 @@ class _SignInTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -549,23 +535,26 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, + onPressed: _isFormInvalid() + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, text: FFLocalizations.of( context) .getText( @@ -576,18 +565,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -614,7 +597,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -622,13 +606,20 @@ class _SignInTemplateComponentWidgetState borderRadius: BorderRadius.circular( 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), showLoadingIndicator: false, ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: () async { @@ -646,18 +637,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -684,7 +669,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -709,36 +695,27 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model.emailAddressTextController - .text == - '') || - ((_model.emailAddressFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.emailAddressTextController - .text == - '') || - ((_model.passwordTextController.text == - '') || - ((_model.passwordFocusNode?.hasFocus ?? - false) != - null)))) + onPressed: _isFormInvalid() ? null : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); + try { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + } catch (e, s) { + await DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s); + } }, text: FFLocalizations.of( context) @@ -750,18 +727,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -789,7 +760,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -798,10 +770,10 @@ class _SignInTemplateComponentWidgetState BorderRadius .circular(12.0), disabledColor: - const Color(0xE81AAB5F), + const Color( + 0xE81AAB5F), ), - showLoadingIndicator: - false, + showLoadingIndicator: true, ), ), ), @@ -810,7 +782,7 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: () async { await widget @@ -827,18 +799,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -866,7 +832,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -880,7 +847,8 @@ class _SignInTemplateComponentWidgetState ), ), ), - ].divide(const SizedBox(width: 7.0)), + ].divide( + const SizedBox(width: 7.0)), ); } }, @@ -888,8 +856,8 @@ class _SignInTemplateComponentWidgetState // You will have to add an action on this rich text to go to your login page. Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -898,21 +866,15 @@ class _SignInTemplateComponentWidgetState onTap: () async { await showModalBottomSheet( isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, + backgroundColor: Colors.transparent, context: context, builder: (context) { return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), + padding: MediaQuery.viewInsetsOf(context), + child: const ForgotPasswordTemplateComponentWidget(), ); }, - ).then( - (value) => safeSetState(() {})); + ).then((value) => safeSetState(() {})); }, child: RichText( textScaler: MediaQuery.of(context) @@ -958,29 +920,23 @@ class _SignInTemplateComponentWidgetState ), mouseCursor: SystemMouseCursors.click, - recognizer: - TapGestureRecognizer() - ..onTap = () async { - await showModalBottomSheet( - isScrollControlled: - true, - backgroundColor: - Colors - .transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState( - () {})); - }, + // recognizer: TapGestureRecognizer() + // ..onTap = () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // context: context, + // useRootNavigator: true, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: const ForgotPasswordTemplateComponentWidget(), + // ); + // }, + // ).then((value) => + // safeSetState( + // () {})); + // }, ) ], style: @@ -1003,35 +959,7 @@ class _SignInTemplateComponentWidgetState ), ), ), - GestureDetector( - onTap: () async { - await action_blocks.openTermsOfUse(context); - }, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Termos de uso', - enText: 'Terms of use', - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), + const AtomTermsOfUse(), ], ), ), diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart new file mode 100644 index 00000000..370ff262 --- /dev/null +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart @@ -0,0 +1,96 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_up_template_component_widget.dart' + show SignUpTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignUpTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for nameRegisterForm widget. + FocusNode? nameRegisterFormFocusNode; + TextEditingController? nameRegisterFormTextController; + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3bs10dfq' /* Campo é necessário */, + ); + } + + return null; + } + + // State field(s) for emailRegisterForm widget. + FocusNode? emailRegisterFormFocusNode; + TextEditingController? emailRegisterFormTextController; + String? Function(BuildContext, String?)? + emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'mlvw63yj' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 'vobnktrz' /* Insira um email valido. */, + ); + } + return null; + } + + // State field(s) for passwordRegisterForm widget. + FocusNode? passwordRegisterFormFocusNode; + TextEditingController? passwordRegisterFormTextController; + late bool passwordRegisterFormVisibility; + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '6nn79lmh' /* Campo é necessário */, + ); + } + + if (val.length < 8) { + return FFLocalizations.of(context).getText( + 'duq5gpp6' /* A senha deve ter pelo menos 8 ... */, + ); + } + + return null; + } + + // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. + bool? signUp; + + @override + void initState(BuildContext context) { + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; + passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; + } + + @override + void dispose() { + nameRegisterFormFocusNode?.dispose(); + nameRegisterFormTextController?.dispose(); + + emailRegisterFormFocusNode?.dispose(); + emailRegisterFormTextController?.dispose(); + + passwordRegisterFormFocusNode?.dispose(); + passwordRegisterFormTextController?.dispose(); + } +} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/component.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart similarity index 89% rename from lib/pages/onboarding/signup/component.dart rename to lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index 50e21802..8b0eac27 100644 --- a/lib/pages/onboarding/signup/component.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -1,113 +1,26 @@ -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/validator_util.dart'; + +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'component.dart'; - - - -class SignUpTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '3bs10dfq' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } - return null; - } - - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - String? _emailRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'mlvw63yj' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '6nn79lmh' /* Campo é necessário */, - ); - } - - return null; - } - - // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. - bool? signUp; - - @override - void initState(BuildContext context) { - nameRegisterFormTextControllerValidator = - _nameRegisterFormTextControllerValidator; - emailRegisterFormTextControllerValidator = - _emailRegisterFormTextControllerValidator; - passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = - _passwordRegisterFormTextControllerValidator; - } - - @override - void dispose() { - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); - } -} - - +import 'sign_up_template_component_model.dart'; +export 'sign_up_template_component_model.dart'; class SignUpTemplateComponentWidget extends StatefulWidget { const SignUpTemplateComponentWidget({ super.key, required this.toggleSignInPage, }); - final Future Function()? toggleSignInPage; @override @@ -188,6 +101,28 @@ class _SignUpTemplateComponentWidgetState @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + bool _isFormInvalid() { + if (_model.nameRegisterFormTextController.text == '' || + _model.emailRegisterFormTextController.text == '' || + _model.passwordRegisterFormTextController.text == '') { + return true; + } + + if (!ValidatorUtil.isValidEmail( + _model.emailRegisterFormTextController.text)) { + return true; + } + + if (!ValidatorUtil.isValidPassword( + _model.passwordRegisterFormTextController.text)) { + return true; + } + + return false; + } + context.watch(); return Row( @@ -225,7 +160,8 @@ class _SignUpTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), + alignment: + const AlignmentDirectional(0.0, -1.0), child: Padding( padding: const EdgeInsets.all(4.0), child: Text( @@ -239,7 +175,7 @@ class _SignUpTemplateComponentWidgetState fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context) .primaryText, - fontSize: 24.0, + fontSize: screenWidth * 0.06, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -261,11 +197,10 @@ class _SignUpTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, + child: const AtomImageSvgTheme( + filename: 'register', + width: 600, + height: 155, ), ), ), @@ -303,8 +238,9 @@ class _SignUpTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -437,8 +373,6 @@ class _SignUpTemplateComponentWidgetState .containsKey( 'Plus Jakarta Sans'), ), - keyboardType: - TextInputType.name, validator: _model .nameRegisterFormTextControllerValidator .asValidator(context), @@ -446,8 +380,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -589,8 +524,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -654,7 +590,8 @@ class _SignUpTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -665,7 +602,8 @@ class _SignUpTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -676,7 +614,8 @@ class _SignUpTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -742,10 +681,12 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { + onPressed: _isFormInvalid() + ? null + : () async { var shouldSetState = false; _model.signUp = await action_blocks @@ -785,11 +726,11 @@ class _SignUpTemplateComponentWidgetState options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), iconPadding: - const EdgeInsetsDirectional.fromSTEB( + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context) .accent1, @@ -817,15 +758,19 @@ class _SignUpTemplateComponentWidgetState ), borderRadius: BorderRadius.circular(12.0), + disabledColor: + FlutterFlowTheme.of(context) + .customColor5, + disabledTextColor: Colors.white, ), - showLoadingIndicator: false, + showLoadingIndicator: true, ), ), // You will have to add an action on this rich text to go to your login page. Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -843,9 +788,8 @@ class _SignUpTemplateComponentWidgetState TextSpan( text: FFLocalizations.of( context) - .getVariableText( - ptText: 'Você já tem uma conta? ', - enText: 'Already have an account? ', + .getText( + 'a9smhn5b' /* Você já tem uma conta? */, ), style: TextStyle( color: FlutterFlowTheme.of( @@ -900,6 +844,7 @@ class _SignUpTemplateComponentWidgetState ), ), ), + const AtomTermsOfUse(), ], ), ), @@ -910,26 +855,6 @@ class _SignUpTemplateComponentWidgetState ), ], ), - GestureDetector( - onTap: () async { - await action_blocks.openTermsOfUse(context); - }, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Termos de uso', - enText: 'Terms of use', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), ], ), ), diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/view_visit_detail/model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart similarity index 92% rename from lib/modals/details/view_visit_detail/model.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart index fcb9ff02..a5726bc8 100644 --- a/lib/modals/details/view_visit_detail/model.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ViewVisitDetailWidget; +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget; import 'package:flutter/material.dart'; class ViewVisitDetailModel extends FlutterFlowModel { diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/view_visit_detail/widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart similarity index 95% rename from lib/modals/details/view_visit_detail/widget.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index dd308931..0b82c87a 100644 --- a/lib/modals/details/view_visit_detail/widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -1,23 +1,24 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:share_plus/share_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'view_visit_detail_model.dart'; +export 'view_visit_detail_model.dart'; class ViewVisitDetailWidget extends StatefulWidget { const ViewVisitDetailWidget({ @@ -100,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State { TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= @@ -211,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), @@ -869,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State { Share.share( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', ); - }, ), ], diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/visit_details_modal/model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart similarity index 67% rename from lib/modals/details/visit_details_modal/model.dart rename to lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index 9fdddf3d..9ec1e19d 100644 --- a/lib/modals/details/visit_details_modal/model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,11 +1,10 @@ -import 'package:hub/modals/details/schedule_visit_detail/model.dart'; -import 'package:hub/modals/details/view_visit_detail/model.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; class VisitDetailsModalTemplateComponentModel @@ -33,4 +32,4 @@ class VisitDetailsModalTemplateComponentModel viewVisitDetailModel.dispose(); scheduleVisitDetailModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart new file mode 100644 index 00000000..a5e922e8 --- /dev/null +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { + const VisitDetailsModalTemplateComponentWidget({ + super.key, + this.visitStatusStr, + this.visitStartDateStr, + this.visitEndDateStr, + this.visitReasonStr, + this.visitLevelStr, + this.visitTempStr, + this.visitObsStr, + this.visitorStrList, + this.visitorJsonList, + this.visitorImgPath, + this.visitorImgList, + this.visitIdStr, + this.updateToggleIdx, + this.repeatVisitSchedule, + this.visitStatusColor, + }); + + final String? visitStatusStr; + final String? visitStartDateStr; + final String? visitEndDateStr; + final String? visitReasonStr; + final String? visitLevelStr; + final String? visitTempStr; + final String? visitObsStr; + final String? visitorStrList; + final List? visitorJsonList; + final String? visitorImgPath; + final List? visitorImgList; + final String? visitIdStr; + final Future Function()? updateToggleIdx; + final Future Function()? repeatVisitSchedule; + final Color? visitStatusColor; + + @override + State createState() => + _VisitDetailsModalTemplateComponentWidgetState(); +} + +class _VisitDetailsModalTemplateComponentWidgetState + extends State { + late VisitDetailsModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitDetailsModalTemplateComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Builder( + builder: (context) { + if (widget.visitStatusStr != null && widget.visitStatusStr != '') { + return wrapWithModel( + model: _model.viewVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ViewVisitDetailWidget( + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitReasonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitStatusStr: widget.visitStatusStr!, + visitorStrList: widget.visitorStrList!, + visitorJsonList: widget.visitorJsonList, + visitIdStr: widget.visitIdStr!, + visitStatusColor: widget.visitStatusColor!, + ), + ); + } else { + return wrapWithModel( + model: _model.scheduleVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ScheduleVisitDetailWidget( + visitorStrList: widget.visitorStrList!, + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitResonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitorJsonList: widget.visitorJsonList!, + ), + ); + } + }, + ); + } +} diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/visit_request/model.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart similarity index 90% rename from lib/modals/notifications/visit_request/model.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart index e2f51aa9..a5a7eb07 100644 --- a/lib/modals/notifications/visit_request/model.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitRequestTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitRequestTemplateComponentModel extends FlutterFlowModel { @@ -55,4 +55,4 @@ class VisitRequestTemplateComponentModel textFieldFocusNodeStatus?.dispose(); textControllerStatus?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/visit_request/widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart similarity index 99% rename from lib/modals/notifications/visit_request/widget.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index 0cd9507d..faae71ee 100644 --- a/lib/modals/notifications/visit_request/widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -1,13 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; + class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ @@ -835,4 +836,4 @@ class _VisitRequestTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/visitor_details_modal/model.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart similarity index 73% rename from lib/modals/details/visitor_details_modal/model.dart rename to lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart index a28e1ad4..d0f79706 100644 --- a/lib/modals/details/visitor_details_modal/model.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart @@ -1,5 +1,5 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'visitor_details_modal_template_component_widget.dart' show VisitorDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart new file mode 100644 index 00000000..307ba81b --- /dev/null +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -0,0 +1,284 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'visitor_details_modal_template_component_model.dart'; +export 'visitor_details_modal_template_component_model.dart'; + +class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { + const VisitorDetailsModalTemplateComponentWidget( + {super.key, + required this.visitorImageURL, + required this.visitorName, + required this.visitorType, + required this.visitorPhone, + required this.visitorEmail}); + + final String? visitorImageURL; + final String? visitorName; + final String? visitorType; + final String? visitorPhone; + final String? visitorEmail; + + @override + State createState() => + _VisitorDetailsModalTemplateComponentWidgetState(); +} + +class _VisitorDetailsModalTemplateComponentWidgetState + extends State { + late VisitorDetailsModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitorDetailsModalTemplateComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(25.0), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: double.infinity, + height: 34.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryText, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 5.0, 15.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 24.0, + ), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 40.0, 20.0, 0.0), + child: Container( + decoration: const BoxDecoration( + shape: BoxShape.rectangle, + ), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (widget.visitorImageURL != '' && + widget.visitorImageURL != null) + Container( + width: 100.0, + height: 100.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + widget.visitorImageURL!, + fit: BoxFit.cover, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + widget.visitorName ?? '', + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'hz7ivuqn' /* Tipo de Visitante */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.phone, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rwqn0det' /* (00) 0 0000-0000 */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '0wqbiekp' /* email@provider.etc */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: double.infinity, + // height: 34.0, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryText, + // borderRadius: const BorderRadius.only( + // bottomLeft: Radius.circular(0.0), + // bottomRight: Radius.circular(0.0), + // topLeft: Radius.circular(0.0), + // topRight: Radius.circular(0.0), + // ), + // ), + // ), + // ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/browsers/visitor_browser/model.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart similarity index 85% rename from lib/modals/browsers/visitor_browser/model.dart rename to lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart index dff255f2..1b473920 100644 --- a/lib/modals/browsers/visitor_browser/model.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart @@ -1,8 +1,8 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitorSearchModalTemplateComponentWidget; import 'package:flutter/material.dart'; class VisitorSearchModalTemplateComponentModel @@ -43,4 +43,4 @@ class VisitorSearchModalTemplateComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart new file mode 100644 index 00000000..963676a9 --- /dev/null +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -0,0 +1,482 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.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:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; + +class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { + const VisitorSearchModalTemplateComponentWidget({ + super.key, + this.getVisitors, + this.getDocs, + }); + + final Future Function(List? visitorsParam)? getVisitors; + final Future Function(List? docsParam)? getDocs; + + @override + State createState() => + _VisitorSearchModalTemplateComponentWidgetState(); +} + +class _VisitorSearchModalTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { + late VisitorSearchModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitorSearchModalTemplateComponentModel()); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + onFieldSubmitted: (_) async { + setState(() { + _model.textController?.text = _model.textController.text; + _model.textController?.selection = TextSelection.collapsed( + offset: _model.textController!.text.length); + }); + _model.getVisitorByDoc = + await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: _model.textController.text, + ); + + if (PhpGroup.getVisitorByDocCall.vistanteId( + (_model.getVisitorByDoc?.jsonBody ?? ''), + ) != + '0') { + _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + (_model.getVisitorByDoc?.jsonBody ?? ''), + )); + setState(() {}); + _model.addToDocs(_model.textController.text); + setState(() {}); + } else { + await showAdaptiveDialog( + useSafeArea: true, + context: context, + builder: (context) { + return Dialog( + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Container( + color: Colors.transparent, + // width: MediaQuery.of(context).size.height * 0.1, + // height: + // MediaQuery.of(context).size.height * 0.4, + child: const VisitorNotFoundComponentWidget()), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 'cjlpru1m' /* Procure pelo documento do visi... */, + ), + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + '8i1qszba' /* test */, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + prefixIcon: Icon( + Icons.search_outlined, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + keyboardType: TextInputType.number, + validator: _model.textControllerValidator.asValidator(context), + ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.length > 0) + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 12.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '9coywebh' /* Visitantes encontrados */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 4.0, 12.0, 16.0, 0.0), + child: Text( + _model.visitors.length.toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ], + ), + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = + _model.visitors.map((e) => e).toList(); + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // enableDrag: true, + // isDismissible: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: SizedBox( + // height: 610.0, + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitorItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // visitorEmail: '', + // visitorName: getJsonField( + // visitorItem, + // r'''$.VTE_NOME''', + // )?.toString(), + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: + BorderRadius.circular(40.0), + child: CachedNetworkImage( + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField( + visitorItem, + r'''$.VTE_NOME''', + )?.toString(), + 'NOT FOUND', + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyLargeFamily), + ), + ), + ), + ], + ), + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: + FlutterFlowTheme.of(context) + .customColor6, + size: 20.0, + ), + onPressed: () async { + _model.removeFromVisitors( + visitorItem); + setState(() {}); + }, + ), + ], + ), + ), + ), + ), + ); + }, + ); + }, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + ); + } + }, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.1, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + ), + ], + ), + const SizedBox( + height: 10.0, + ) + ], + ), + ), + ); + } +} diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart new file mode 100644 index 00000000..17ea3047 --- /dev/null +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart @@ -0,0 +1,13 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'welcome_template_component_widget.dart' + show WelcomeTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class WelcomeTemplateComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/component.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart similarity index 97% rename from lib/pages/onboarding/welcome/component.dart rename to lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index e9cece8f..e0b97fe2 100644 --- a/lib/pages/onboarding/welcome/component.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -1,26 +1,15 @@ -import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; -export 'component.dart'; - - -class WelcomeTemplateComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} - - +import 'welcome_template_component_model.dart'; +export 'welcome_template_component_model.dart'; class WelcomeTemplateComponentWidget extends StatefulWidget { const WelcomeTemplateComponentWidget({ @@ -177,7 +166,7 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: const AtomImageSVGTheme(filename: 'welcome', width: 600, height: double.infinity), + child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity), ), ), Align( diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/convert_image_file_to_base64.dart b/lib/custom_code/actions/convert_image_file_to_base64.dart similarity index 55% rename from lib/commons/actions/convert_image_file_to_base64.dart rename to lib/custom_code/actions/convert_image_file_to_base64.dart index 19ff6095..33f4fd83 100644 --- a/lib/commons/actions/convert_image_file_to_base64.dart +++ b/lib/custom_code/actions/convert_image_file_to_base64.dart @@ -1,14 +1,12 @@ + + // Automatic FlutterFlow imports -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:typed_data'; +import '../../flutter_flow/uploaded_file.dart'; Future convertImageFileToBase64(FFUploadedFile imageFile) async { List? imageBytes = imageFile.bytes; @@ -16,4 +14,4 @@ Future convertImageFileToBase64(FFUploadedFile imageFile) async { String base64Image = base64Encode(imageBytes); return base64Image; } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier b/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/convert_to_upload_file.dart b/lib/custom_code/actions/convert_to_upload_file.dart similarity index 73% rename from lib/commons/actions/convert_to_upload_file.dart rename to lib/custom_code/actions/convert_to_upload_file.dart index 2ddde316..e72f0efe 100644 --- a/lib/commons/actions/convert_to_upload_file.dart +++ b/lib/custom_code/actions/convert_to_upload_file.dart @@ -1,11 +1,11 @@ // Automatic FlutterFlow imports -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/backend/schema/structs/index.dart'; +import '/backend/schema/enums/enums.dart'; +import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions +import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! @@ -14,6 +14,7 @@ import 'dart:convert'; // Import for base64 decoding import 'dart:io'; // Import for file operations import 'package:path_provider/path_provider.dart'; // Import for temporary directory + Future convertToUploadFile(String img) async { // Decode the base64 string into bytes Uint8List bytes = base64.decode(img); @@ -29,4 +30,4 @@ Future convertToUploadFile(String img) async { bytes: bytes, name: 'image.jpg', ); -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier b/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart similarity index 91% rename from lib/commons/actions/get_dev_u_u_i_d.dart rename to lib/custom_code/actions/get_dev_u_u_i_d.dart index b9226900..e5df025d 100644 --- a/lib/commons/actions/get_dev_u_u_i_d.dart +++ b/lib/custom_code/actions/get_dev_u_u_i_d.dart @@ -1,17 +1,20 @@ -import '/commons/schema/structs/index.dart'; +import '/backend/schema/structs/index.dart'; import 'dart:developer'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/backend/schema/enums/enums.dart'; +import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions +import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; + + + Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { @@ -58,4 +61,4 @@ Future getSerialNumber() async { log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.serialNumber; // unique ID on Android } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier b/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/index.dart b/lib/custom_code/actions/index.dart similarity index 60% rename from lib/commons/actions/index.dart rename to lib/custom_code/actions/index.dart index 0a097ef0..2110f043 100644 --- a/lib/commons/actions/index.dart +++ b/lib/custom_code/actions/index.dart @@ -1,6 +1,3 @@ export 'convert_image_file_to_base64.dart' show convertImageFileToBase64; export 'convert_to_upload_file.dart' show convertToUploadFile; export 'get_dev_u_u_i_d.dart' show getDevUUID; -export 'actions.dart' show Actions; -export 'api_calls.dart' show ApiCalls; -export 'api_manager.dart' show ApiManager; diff --git a/lib/custom_code/actions/index.dart:Zone.Identifier b/lib/custom_code/actions/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart similarity index 97% rename from lib/commons/widgets/image_cropper.dart rename to lib/custom_code/widgets/image_cropper.dart index 242d059a..90704f46 100644 --- a/lib/commons/widgets/image_cropper.dart +++ b/lib/custom_code/widgets/image_cropper.dart @@ -1,6 +1,6 @@ // // Automatic FlutterFlow imports -// import '/commons/schema/structs/index.dart'; -// import '/commons/schema/enums/enums.dart'; +// import '/backend/schema/structs/index.dart'; +// import '/backend/schema/enums/enums.dart'; // import '/actions/actions.dart' as action_blocks; // import '/flutter_flow/flutter_flow_theme.dart'; // import '/flutter_flow/flutter_flow_util.dart'; @@ -13,7 +13,9 @@ // import 'package:crop_your_image/crop_your_image.dart'; // import 'package:google_fonts/google_fonts.dart'; -// import '/commons/firebase_storage/storage.dart'; +// import '/backend/firebase_storage/storage.dart'; + +// ///////////////// // class ImageCropper extends StatefulWidget { // const ImageCropper({ diff --git a/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier b/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/index.dart b/lib/custom_code/widgets/index.dart similarity index 100% rename from lib/commons/widgets/index.dart rename to lib/custom_code/widgets/index.dart diff --git a/lib/custom_code/widgets/index.dart:Zone.Identifier b/lib/custom_code/widgets/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/menu.dart b/lib/custom_code/widgets/menu.dart similarity index 100% rename from lib/commons/widgets/menu.dart rename to lib/custom_code/widgets/menu.dart diff --git a/lib/custom_code/widgets/menu.dart:Zone.Identifier b/lib/custom_code/widgets/menu.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/firebase_options.dart:Zone.Identifier b/lib/firebase_options.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/custom_functions.dart b/lib/flutter_flow/custom_functions.dart similarity index 97% rename from lib/commons/widgets/custom_functions.dart rename to lib/flutter_flow/custom_functions.dart index 1c663fdc..f33176c1 100644 --- a/lib/commons/widgets/custom_functions.dart +++ b/lib/flutter_flow/custom_functions.dart @@ -8,8 +8,7 @@ import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; + String? isOneAcliID(String jsonString) { // Converte o JSON em um Map diff --git a/lib/flutter_flow/custom_functions.dart:Zone.Identifier b/lib/flutter_flow/custom_functions.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/custom_icons.dart b/lib/flutter_flow/custom_icons.dart similarity index 99% rename from lib/commons/widgets/custom_icons.dart rename to lib/flutter_flow/custom_icons.dart index 52991086..07cebe2e 100644 --- a/lib/commons/widgets/custom_icons.dart +++ b/lib/flutter_flow/custom_icons.dart @@ -18,4 +18,4 @@ class FFIcons { IconData(0xe900, fontFamily: _menuFamily); static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily); static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/custom_icons.dart:Zone.Identifier b/lib/flutter_flow/custom_icons.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_animations.dart b/lib/flutter_flow/flutter_flow_animations.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_animations.dart rename to lib/flutter_flow/flutter_flow_animations.dart index 486179ca..c101a376 100644 --- a/lib/commons/widgets/flutter_flow_animations.dart +++ b/lib/flutter_flow/flutter_flow_animations.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; + enum AnimationTrigger { onPageLoad, onActionTrigger, @@ -108,4 +109,4 @@ class TiltEffect extends Effect { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_button_tabbar.dart b/lib/flutter_flow/flutter_flow_button_tabbar.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_button_tabbar.dart rename to lib/flutter_flow/flutter_flow_button_tabbar.dart index fcf320b3..4ea6374d 100644 --- a/lib/commons/widgets/flutter_flow_button_tabbar.dart +++ b/lib/flutter_flow/flutter_flow_button_tabbar.dart @@ -6,6 +6,8 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; + + const double _kTabHeight = 46.0; typedef _LayoutCallback = void Function( @@ -851,4 +853,4 @@ class _FlutterFlowButtonTabBarState extends State return tabBar; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_checkbox_group.dart b/lib/flutter_flow/flutter_flow_checkbox_group.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_checkbox_group.dart rename to lib/flutter_flow/flutter_flow_checkbox_group.dart index 61e5f3df..fc089d10 100644 --- a/lib/commons/widgets/flutter_flow_checkbox_group.dart +++ b/lib/flutter_flow/flutter_flow_checkbox_group.dart @@ -4,6 +4,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +//// + + class FlutterFlowCheckboxGroup extends StatefulWidget { const FlutterFlowCheckboxGroup({ super.key, @@ -131,4 +134,4 @@ class _FlutterFlowCheckboxGroupState extends State { ); }, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart similarity index 83% rename from lib/commons/widgets/flutter_flow_drop_down.dart rename to lib/flutter_flow/flutter_flow_drop_down.dart index 0e7bc61c..ab6bdf5e 100644 --- a/lib/commons/widgets/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -1,5 +1,7 @@ import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; + import 'form_field_controller.dart'; import 'package:flutter/material.dart'; @@ -212,12 +214,11 @@ class _FlutterFlowDropDownState extends State> { List> _createMenuItems() => widget.options .map( (option) => DropdownMenuItem( - value: option, - child: Padding( - padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, - child: Text(optionLabels[option] ?? '', style: widget.textStyle), - ), - ), + value: option, + child: Padding( + padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, + child: Text(optionLabels[option] ?? '', style: widget.textStyle), + )), ) .toList(); @@ -232,37 +233,36 @@ class _FlutterFlowDropDownState extends State> { final isSelected = multiSelectController.value?.contains(item) ?? false; return InkWell( - onTap: () { - multiSelectController.value ??= []; - isSelected - ? multiSelectController.value!.remove(item) - : multiSelectController.value!.add(item); - multiSelectController.update(); - // This rebuilds the StatefulWidget to update the button's text. - setState(() {}); - // This rebuilds the dropdownMenu Widget to update the check mark. - menuSetState(() {}); - }, - child: Container( - height: double.infinity, - padding: horizontalMargin, - child: Row( - children: [ - if (isSelected) - const Icon(Icons.check_box_outlined) - else - const Icon(Icons.check_box_outline_blank), - const SizedBox(width: 16), - Expanded( - child: Text( - optionLabels[item]!, - style: widget.textStyle, + onTap: () { + multiSelectController.value ??= []; + isSelected + ? multiSelectController.value!.remove(item) + : multiSelectController.value!.add(item); + multiSelectController.update(); + // This rebuilds the StatefulWidget to update the button's text. + setState(() {}); + // This rebuilds the dropdownMenu Widget to update the check mark. + menuSetState(() {}); + }, + child: Container( + height: double.infinity, + padding: horizontalMargin, + child: Row( + children: [ + if (isSelected) + const Icon(Icons.check_box_outlined) + else + const Icon(Icons.check_box_outline_blank), + const SizedBox(width: 16), + Expanded( + child: Text( + optionLabels[item]!, + style: widget.textStyle, + ), ), - ), - ], - ), - ), - ); + ], + ), + )); }, ), ), @@ -305,21 +305,19 @@ class _FlutterFlowDropDownState extends State> { : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val), isExpanded: true, selectedItemBuilder: (context) => widget.options - .map( - (item) => Align( - alignment: AlignmentDirectional.centerStart, - child: Text( - isMultiSelect - ? currentValues - .where((v) => optionLabels.containsKey(v)) - .map((v) => optionLabels[v]) - .join(', ') - : optionLabels[item]!, - style: widget.textStyle, - maxLines: 1, - ), - ), - ) + .map((item) => Align( + alignment: AlignmentDirectional.centerStart, + child: Text( + isMultiSelect + ? currentValues + .where((v) => optionLabels.containsKey(v)) + .map((v) => optionLabels[v]) + .join(', ') + : optionLabels[item]!, + style: widget.textStyle, + maxLines: 1, + ), + )) .toList(), dropdownSearchData: widget.isSearchable ? DropdownSearchData( @@ -370,4 +368,4 @@ class _FlutterFlowDropDownState extends State> { : null, ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_icon_button.dart b/lib/flutter_flow/flutter_flow_icon_button.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_icon_button.dart rename to lib/flutter_flow/flutter_flow_icon_button.dart index 6e77c8a0..d41b72bb 100644 --- a/lib/commons/widgets/flutter_flow_icon_button.dart +++ b/lib/flutter_flow/flutter_flow_icon_button.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + + class FlutterFlowIconButton extends StatefulWidget { const FlutterFlowIconButton({ super.key, @@ -167,4 +169,4 @@ class _FlutterFlowIconButtonState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_model.dart b/lib/flutter_flow/flutter_flow_model.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_model.dart rename to lib/flutter_flow/flutter_flow_model.dart index 5a1225da..93752ff6 100644 --- a/lib/commons/widgets/flutter_flow_model.dart +++ b/lib/flutter_flow/flutter_flow_model.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; + Widget wrapWithModel({ required T model, required Widget child, @@ -164,4 +165,4 @@ T? _getDefaultValue() { extension TextValidationExtensions on String? Function(BuildContext, String?)? { String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_theme.dart rename to lib/flutter_flow/flutter_flow_theme.dart index 9bc83617..a924cb38 100644 --- a/lib/commons/widgets/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; + const kThemeModeKey = '__theme_mode__'; SharedPreferences? _prefs; @@ -619,4 +620,4 @@ extension TextStyleHelper on TextStyle { height: lineHeight, shadows: shadows, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart similarity index 84% rename from lib/commons/widgets/flutter_flow_util.dart rename to lib/flutter_flow/flutter_flow_util.dart index 3d793c08..8a3cc1be 100644 --- a/lib/commons/widgets/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -11,8 +11,7 @@ import 'package:json_path/json_path.dart'; import 'package:timeago/timeago.dart' as timeago; import 'package:url_launcher/url_launcher.dart'; -import '/main.dart'; - +import '../main.dart'; export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; @@ -27,7 +26,6 @@ export 'package:intl/intl.dart'; export 'package:page_transition/page_transition.dart'; export 'custom_icons.dart' show FFIcons; export 'internationalization.dart' show FFLocalizations; -export 'package:hub/commons/actions/nav.dart'; T valueOrDefault(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value; @@ -88,6 +86,46 @@ Theme wrapInMaterialDatePickerTheme( return Theme( data: baseTheme.copyWith( + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), colorScheme: baseTheme.colorScheme.copyWith( onSurface: pickerForegroundColor, ), @@ -150,9 +188,54 @@ Theme wrapInMaterialTimePickerTheme( final baseTheme = Theme.of(context); return Theme( data: baseTheme.copyWith( + focusColor: headerBackgroundColor, iconTheme: baseTheme.iconTheme.copyWith( size: iconSize, ), + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + focusColor: headerBackgroundColor, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + outlineBorder: BorderSide( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( foregroundColor: WidgetStatePropertyAll( @@ -170,6 +253,7 @@ Theme wrapInMaterialTimePickerTheme( })), ), timePickerTheme: baseTheme.timePickerTheme.copyWith( + hourMinuteColor: selectedDateTimeBackgroundColor, backgroundColor: pickerBackgroundColor, hourMinuteTextColor: pickerForegroundColor, dialHandColor: selectedDateTimeBackgroundColor, @@ -396,8 +480,15 @@ extension FFTextEditingControllerExt on TextEditingController? { } extension IterableExt on Iterable { - List sortedList([S Function(T)? keyOf]) => toList() - ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + List sortedList( + {S Function(T)? keyOf, bool desc = false}) { + final sortedAscending = toList() + ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + if (desc) { + return sortedAscending.reversed.toList(); + } + return sortedAscending; + } List mapIndexed(S Function(int, T) func) => toList() .asMap() diff --git a/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_widgets.dart rename to lib/flutter_flow/flutter_flow_widgets.dart index 5f36df96..f9db2be0 100644 --- a/lib/commons/widgets/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -2,6 +2,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:flutter/material.dart'; import 'package:auto_size_text/auto_size_text.dart'; + class FFButtonOptions { const FFButtonOptions({ this.textAlign, @@ -285,4 +286,4 @@ double? _getTextWidth(String? text, TextStyle? style, int maxLines) => )..layout()) .size .width - : null; + : null; \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/form_field_controller.dart b/lib/flutter_flow/form_field_controller.dart similarity index 99% rename from lib/commons/widgets/form_field_controller.dart rename to lib/flutter_flow/form_field_controller.dart index b8020e3b..1d152bb9 100644 --- a/lib/commons/widgets/form_field_controller.dart +++ b/lib/flutter_flow/form_field_controller.dart @@ -1,5 +1,6 @@ import 'package:flutter/foundation.dart'; + class FormFieldController extends ValueNotifier { FormFieldController(this.initialValue) : super(initialValue); @@ -20,4 +21,4 @@ class FormListFieldController extends FormFieldController> { @override void reset() => value = List.from(_initialListValue ?? []); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/form_field_controller.dart:Zone.Identifier b/lib/flutter_flow/form_field_controller.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/internationalization.dart b/lib/flutter_flow/internationalization.dart similarity index 94% rename from lib/commons/widgets/internationalization.dart rename to lib/flutter_flow/internationalization.dart index 9b26d8dd..ca57ae4a 100644 --- a/lib/commons/widgets/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -152,7 +152,7 @@ final kTranslationsMap = >>[ 'en': 'FREE ACCESS', }, 'mp6igsok': { - 'pt': 'Home', + 'pt': '', 'en': '', }, }, @@ -241,10 +241,6 @@ final kTranslationsMap = >>[ 'pt': 'Qual o período de validade da visita?', 'en': 'Visit Validity Period', }, - 'qygj6ra5': { - 'pt': 'Inicio da Visita', - 'en': 'Start of Visit', - }, 'bv2edxku': { 'pt': '', 'en': 'End of Visit', @@ -253,10 +249,6 @@ final kTranslationsMap = >>[ 'pt': 'Quando você inicia a visita?', 'en': 'When do you start the visit?', }, - 'p4ws3t66': { - 'pt': 'Fim da Visita', - 'en': 'End of Visit', - }, 'yw6d2jj8': { 'pt': '', 'en': 'End of Visit', @@ -269,10 +261,6 @@ final kTranslationsMap = >>[ 'pt': 'Quais são os motivos da visita?', 'en': 'What are the reasons for the visit?', }, - '2f68zi9t': { - 'pt': 'Motivo da Visita', - 'en': 'End of Visit', - }, '6p3e0bzr': { 'pt': 'Escolha um motivo aqui', 'en': 'Choose a reason here', @@ -281,10 +269,6 @@ final kTranslationsMap = >>[ 'pt': 'Search for an item...', 'en': '', }, - 'il4di4ln': { - 'pt': 'Nível de Acesso', - 'en': 'End of Visit', - }, '2wun8p6c': { 'pt': 'Escolha um nível de acesso aqui', 'en': 'Choose an access level here', @@ -490,6 +474,28 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // preferencesPage + { + '1vyj6y7n': { + 'pt': 'Preferencias', + 'en': '', + }, + 'sejj3t8w': { + 'pt': '', + 'en': '', + }, + }, + // settingsPage + { + 'bc698859': { + 'pt': 'Preferencias', + 'en': '', + }, + 'sejj3t8w': { + 'pt': '', + 'en': '', + }, + }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -563,8 +569,8 @@ final kTranslationsMap = >>[ // throwException { 'e58xxxiq': { - 'pt': 'ERRO', - 'en': 'ERROR', + 'pt': 'Falha :(', + 'en': 'Fail :(', }, }, // regisiterVistorTemplateComponent @@ -844,6 +850,10 @@ final kTranslationsMap = >>[ 'pt': 'Histórico\nde Liberação', 'en': 'Liberation\nHistory', }, + 'dzk31zpc': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, }, // messageWellComponent { @@ -863,24 +873,28 @@ final kTranslationsMap = >>[ 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', }, '1ltg0ylb': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, '2x19ce8k': { 'pt': 'Senha', 'en': 'Password', }, 'xhnawzcb': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', + }, + 's3j1hjqx': { + 'pt': 'E-mail Inválido', + 'en': 'Invalid E-mail', }, '2ib9bf67': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, '9cs5wlmc': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', }, 'rkxwb0sg': { 'pt': 'Please choose an option from the dropdown', @@ -908,7 +922,7 @@ final kTranslationsMap = >>[ }, 'p5c6d54y': { 'pt': ' Recupere aqui', - 'en': 'recover here', + 'en': ' Recover here', }, 'olf967cj': { 'pt': 'Termo de Uso', @@ -938,24 +952,32 @@ final kTranslationsMap = >>[ 'en': 'Password', }, '3bs10dfq': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Nome é Obrigatório', + 'en': 'Name is required', }, 'ph22karc': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, 'mlvw63yj': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', + }, + 'vobnktrz': { + 'pt': 'E-mail Inválido.', + 'en': 'Invalid E-mail', }, 'z0bv6wi2': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, '6nn79lmh': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', + }, + 'duq5gpp6': { + 'pt': 'Mínimo 8 caracteres.', + 'en': 'Minimum 8 characters.', }, 'rcikqhf1': { 'pt': 'Please choose an option from the dropdown', @@ -1018,12 +1040,24 @@ final kTranslationsMap = >>[ 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, 'mtz8l7ft': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, 'w7y5wlnv': { - 'pt': 'digite o seu email.....', - 'en': 'enter your email.....', + 'pt': '', + 'en': '', + }, + '3hqg8buh': { + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is Required', + }, + 'jh5r2b1w': { + 'pt': 'E-mail Inválido', + 'en': 'Invalid E-mail', + }, + '1p76vmkn': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', }, '74rnd5bu': { 'pt': 'Enviar', diff --git a/lib/flutter_flow/internationalization.dart:Zone.Identifier b/lib/flutter_flow/internationalization.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/keep_alive_wrapper.dart b/lib/flutter_flow/keep_alive_wrapper.dart similarity index 99% rename from lib/commons/widgets/keep_alive_wrapper.dart rename to lib/flutter_flow/keep_alive_wrapper.dart index 286bde09..fd9c5150 100644 --- a/lib/commons/widgets/keep_alive_wrapper.dart +++ b/lib/flutter_flow/keep_alive_wrapper.dart @@ -22,4 +22,4 @@ class _KeepAliveWidgetWrapperState extends State super.build(context); return widget.builder(context); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier b/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/lat_lng.dart b/lib/flutter_flow/lat_lng.dart similarity index 99% rename from lib/commons/widgets/lat_lng.dart rename to lib/flutter_flow/lat_lng.dart index 9e7b8ea8..68758f91 100644 --- a/lib/commons/widgets/lat_lng.dart +++ b/lib/flutter_flow/lat_lng.dart @@ -16,4 +16,4 @@ class LatLng { other is LatLng && latitude == other.latitude && longitude == other.longitude; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/lat_lng.dart:Zone.Identifier b/lib/flutter_flow/lat_lng.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/nav.dart b/lib/flutter_flow/nav/nav.dart similarity index 89% rename from lib/commons/actions/nav.dart rename to lib/flutter_flow/nav/nav.dart index 955e4cce..86f9ca21 100644 --- a/lib/commons/actions/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -1,32 +1,17 @@ import 'dart:async'; -// import 'package:hub/pages/consult/access/acess_history_page_widget.dart'; -// import 'package:hub/pages/schedule/visit/fastpass/fast_pass_page_widget.dart'; -// import 'package:hub/pages/consult/message/message_history_page_widget.dart'; -// import 'package:hub/pages/settings/preferences_settings_widget.dart'; -// import 'package:hub/pages/consult/visit/visit_history_page_widget.dart'; - import 'package:flutter/material.dart'; -import 'package:hub/pages/consults/access/widget.dart'; -import 'package:hub/pages/consults/liberation/widget.dart'; -import 'package:hub/pages/consults/message/widget.dart'; -import 'package:hub/pages/consults/poeple/widget.dart'; -import 'package:hub/pages/consults/qrcode/widget.dart'; -import 'package:hub/pages/consults/visit/widget.dart'; -import 'package:hub/pages/home/widget.dart'; -import 'package:hub/pages/onboarding/signin/widget.dart'; -import 'package:hub/pages/onboarding/signup/widget.dart'; -import 'package:hub/pages/onboarding/welcome/widget.dart'; -import 'package:hub/pages/registers/visitor/widget.dart'; -import 'package:hub/pages/schedules/visit/complete/widget.dart'; -import 'package:hub/pages/schedules/visit/fastpass/widget.dart'; -import 'package:hub/pages/schedules/visit/provisional/widget.dart'; -import 'package:hub/pages/settings/widget.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; import 'package:provider/provider.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + +import '../../main.dart'; +import '/backend/schema/structs/index.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import '/index.dart'; -// import '../../pages//visit_history_page_widget.dart'; +import '../../pages/visit_history_page/visit_history_page_widget.dart'; export 'package:go_router/go_router.dart'; @@ -34,6 +19,8 @@ export 'serialization_util.dart'; const kTransitionInfoKey = '__transition_info__'; +/// + class AppStateNotifier extends ChangeNotifier { AppStateNotifier._(); @@ -89,7 +76,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => const HomePageWidget(), + builder: (context, params) => params.isEmpty + ? const HomePageWidget() + : const HomePageWidget(), ), FFRoute( name: 'visitHistoryPage', @@ -199,7 +188,19 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget(), - ) + ), + FFRoute( + name: 'preferencesPage', + path: '/preferencesPage', + builder: (context, params) => const PreferencesPageWidget(), + ), + // FFRoute( + // name: 'settingsPage', + // path: '/settingsPage', + // builder: (context, params) => params.isEmpty + // ? const NavBarPage(initialPage: 'settingsPage') + // : const SettingsPageWidget(), + // ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); @@ -396,4 +397,4 @@ extension GoRouterLocationExtension on GoRouter { : routerDelegate.currentConfiguration; return matchList.uri.toString(); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/nav.dart:Zone.Identifier b/lib/flutter_flow/nav/nav.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart similarity index 96% rename from lib/commons/actions/serialization_util.dart rename to lib/flutter_flow/nav/serialization_util.dart index 6b04b1b2..887c8eec 100644 --- a/lib/commons/actions/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -3,12 +3,13 @@ import 'dart:developer'; import 'package:flutter/material.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; +import '/backend/schema/structs/index.dart'; +import '/backend/schema/enums/enums.dart'; + +import '../../flutter_flow/lat_lng.dart'; +import '../../flutter_flow/place.dart'; +import '../../flutter_flow/uploaded_file.dart'; -import '/commons/widgets/lat_lng.dart'; -import '/commons/widgets/place.dart'; -import '/commons/widgets/uploaded_file.dart'; /// SERIALIZATION HELPERS @@ -228,4 +229,4 @@ dynamic deserializeParam( log('Error deserializing parameter: $e'); return null; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier b/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/permissions_util.dart b/lib/flutter_flow/permissions_util.dart similarity index 94% rename from lib/commons/widgets/permissions_util.dart rename to lib/flutter_flow/permissions_util.dart index c7b8c2ff..304c8a17 100644 --- a/lib/commons/widgets/permissions_util.dart +++ b/lib/flutter_flow/permissions_util.dart @@ -15,4 +15,4 @@ Future getPermissionStatus(Permission setting) async { } Future requestPermission(Permission setting) async => - await setting.request(); + await setting.request(); \ No newline at end of file diff --git a/lib/flutter_flow/permissions_util.dart:Zone.Identifier b/lib/flutter_flow/permissions_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/place.dart b/lib/flutter_flow/place.dart similarity index 99% rename from lib/commons/widgets/place.dart rename to lib/flutter_flow/place.dart index e3589b3b..972fb8be 100644 --- a/lib/commons/widgets/place.dart +++ b/lib/flutter_flow/place.dart @@ -43,4 +43,4 @@ class FFPlace { state == other.state && country == other.country && zipCode == other.zipCode; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/place.dart:Zone.Identifier b/lib/flutter_flow/place.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/random_data_util.dart b/lib/flutter_flow/random_data_util.dart similarity index 99% rename from lib/commons/widgets/random_data_util.dart rename to lib/flutter_flow/random_data_util.dart index 6599e5a6..fd966a2c 100644 --- a/lib/commons/widgets/random_data_util.dart +++ b/lib/flutter_flow/random_data_util.dart @@ -48,4 +48,4 @@ String randomImageUrl(int width, int height) { Color randomColor() { return Color.fromARGB( 255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/random_data_util.dart:Zone.Identifier b/lib/flutter_flow/random_data_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/request_manager.dart b/lib/flutter_flow/request_manager.dart similarity index 98% rename from lib/commons/widgets/request_manager.dart rename to lib/flutter_flow/request_manager.dart index f26ed03b..c9b4dcc8 100644 --- a/lib/commons/widgets/request_manager.dart +++ b/lib/flutter_flow/request_manager.dart @@ -90,4 +90,4 @@ class StreamRequestManager { } String _requestKey(String? key) => - key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; \ No newline at end of file diff --git a/lib/flutter_flow/request_manager.dart:Zone.Identifier b/lib/flutter_flow/request_manager.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/upload_data.dart b/lib/flutter_flow/upload_data.dart similarity index 87% rename from lib/commons/widgets/upload_data.dart rename to lib/flutter_flow/upload_data.dart index 11219e59..c7c4c597 100644 --- a/lib/commons/widgets/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -52,32 +52,32 @@ Future?> selectMediaWithSourceBottomSheet({ required bool allowPhoto, bool allowVideo = false, String pickerFontFamily = 'Roboto', - Color textColor = const Color(0xFF111417), - Color backgroundColor = const Color(0xFFF5F5F5), + // Color textColor = const Color(0xFF111417), + // Color backgroundColor = const Color(0xFFF5F5F5), bool includeDimensions = false, bool includeBlurHash = false, }) async { createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: textColor, - fontWeight: FontWeight.w600, - fontSize: 20, - ), - ), - tileColor: backgroundColor, - dense: false, - onTap: () => Navigator.pop( - context, - mediaSource, - ), - ); + title: Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 20, + ), + ), + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: false, + onTap: () => Navigator.pop( + context, + mediaSource, + ), + ); final mediaSource = await showModalBottomSheet( context: context, - backgroundColor: backgroundColor, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, builder: (context) { return Column( mainAxisSize: MainAxisSize.min, @@ -91,13 +91,15 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), ), - tileColor: backgroundColor, - dense: false, + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: true, ), ), const Divider(), @@ -360,14 +362,22 @@ void showUploadMessage( child: CircularProgressIndicator( valueColor: Theme.of(context).brightness == Brightness.dark ? AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).accent4) + FlutterFlowTheme.of(context).info) : null, ), ), - Text(message), + Text(message, style: FlutterFlowTheme.of(context).bodyMedium), ], ), - duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4), + backgroundColor: FlutterFlowTheme.of(context).primary, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + duration: + showLoading ? const Duration(days: 1) : const Duration(seconds: 4), ), ); } diff --git a/lib/flutter_flow/upload_data.dart:Zone.Identifier b/lib/flutter_flow/upload_data.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/uploaded_file.dart b/lib/flutter_flow/uploaded_file.dart similarity index 99% rename from lib/commons/widgets/uploaded_file.dart rename to lib/flutter_flow/uploaded_file.dart index 2dfd2ff1..cbe68cad 100644 --- a/lib/commons/widgets/uploaded_file.dart +++ b/lib/flutter_flow/uploaded_file.dart @@ -65,4 +65,4 @@ class FFUploadedFile { height == other.height && width == other.width && blurHash == other.blurHash; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/uploaded_file.dart:Zone.Identifier b/lib/flutter_flow/uploaded_file.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/index.dart b/lib/index.dart index 461cd5e3..0e675d5a 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -1,27 +1,27 @@ +export '/pages/home_page/home_page_widget.dart' show HomePageWidget; +export '/pages/register_visitor_page/register_visitor_page_widget.dart' + show RegisterVisitorPageWidget; -export 'pages/index.dart'; +export '/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart' + show ScheduleCompleteVisitPageWidget; -// // CONSULT -// export 'pages/consults/access/' show AcessHistoryPageModel; -// export 'pages/consult/liberation/liberation_history_widget.dart' show LiberationHistoryWidget; -// export 'pages/consult/people/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget; -// export 'pages/consult/qrcode/qr_code_page_widget.dart' show QrCodePageWidget; -// export 'pages/consult/message/message_history_page_widget.dart' show MessageHistoryPageWidget; -// export 'pages/consult/visit/visit_history_page_widget.dart' show VisitHistoryPageWidget; -// /// HOME -// export 'pages/home/home_page_widget.dart' show HomePageWidget; -// /// REGISTER -// export 'pages/register/visitor/register_visitor_page_widget.dart' show RegisterVisitorPageWidget; -// /// SCHEDULE -// export 'pages/schedule/visit/complete/schedule_complete_visit_page_widget.dart' show ScheduleCompleteVisitPageWidget; -// export 'pages/schedule/visit/provisional/schedule_provisional_visit_page_widget.dart' show ScheduleProvisionalVisitPageWidget; -// export 'pages/schedule/visit/fastpass/fast_pass_page_widget.dart' show FastPassPageWidget; -// /// SETTINGS -// export 'pages/settings/preferences_settings_widget.dart' show PreferencesSettingsWidget; -// /// WELCOME -// export 'pages/welcome/welcome_page_widget.dart' show WelcomePageWidget; -// export 'pages/welcome/signin/sign_in_page_widget.dart' show SignInPageWidget; -// export 'pages/welcome/signup/sign_up_page_widget.dart' show SignUpPageWidget; +export '/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart' + show ScheduleProvisionalVisitPageWidget; +export '/pages/people_on_the_property_page/people_on_the_property_page_widget.dart' + show PeopleOnThePropertyPageWidget; +export '/pages/acess_history_page/acess_history_page_widget.dart' + show AcessHistoryPageWidget; + +export '/pages/liberation_history/liberation_history_widget.dart' + show LiberationHistoryWidget; + +export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget; + +export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; + +export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; +export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; +export '/pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget; diff --git a/lib/index.dart:Zone.Identifier b/lib/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/main.dart b/lib/main.dart index e15dc32e..2590c721 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,14 +1,16 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:responsive_framework/responsive_framework.dart'; import 'firebase_options.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; -import 'commons/widgets/flutter_flow_theme.dart'; -import 'commons/widgets/flutter_flow_util.dart'; -import 'commons/widgets/internationalization.dart'; import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); @@ -28,6 +30,8 @@ void main() async { Future initializeApp() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; + await FlutterFlowTheme.initialize(); await FFLocalizations.initialize(); final appState = FFAppState(); @@ -56,6 +60,9 @@ class _MyAppState extends State { @override void initState() { super.initState(); + + FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + _appStateNotifier = AppStateNotifier.instance; _router = createRouter(_appStateNotifier); Future.delayed(const Duration(milliseconds: 1000), @@ -134,4 +141,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} +} \ No newline at end of file diff --git a/lib/main.dart:Zone.Identifier b/lib/main.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/browsers/visitor_browser/widget.dart b/lib/modals/browsers/visitor_browser/widget.dart deleted file mode 100644 index 926c3f6e..00000000 --- a/lib/modals/browsers/visitor_browser/widget.dart +++ /dev/null @@ -1,536 +0,0 @@ - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; -import 'package:hub/modals/exceptions/not_found/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { - const VisitorSearchModalTemplateComponentWidget({ - super.key, - this.getVisitors, - this.getDocs, - }); - - final Future Function(List? visitorsParam)? getVisitors; - final Future Function(List? docsParam)? getDocs; - - @override - State createState() => - _VisitorSearchModalTemplateComponentWidgetState(); -} - -class _VisitorSearchModalTemplateComponentWidgetState - extends State - with TickerProviderStateMixin { - late VisitorSearchModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitorSearchModalTemplateComponentModel()); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - - WidgetsBinding.instance.addPostFrameCallback((_) => setState(() { - _model.textController?.text = FFLocalizations.of(context).getText( - 'oj12tamm' /* test */, - ); - })); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 300.0, 0.0, 0.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - onFieldSubmitted: (_) async { - setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); - _model.textController?.selection = - TextSelection.collapsed( - offset: _model.textController!.text.length); - }); - _model.getVisitorByDoc = - await PhpGroup.getVisitorByDocCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitante', - documento: _model.textController.text, - ); - - if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { - _model - .addToVisitors(PhpGroup.getVisitorByDocCall.visitante( - (_model.getVisitorByDoc?.jsonBody ?? ''), - )); - setState(() {}); - _model.addToDocs(_model.textController.text); - setState(() {}); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 'cjlpru1m' /* Procure pelo documento do visi... */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - '8i1qszba' /* test */, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - prefixIcon: Icon( - Icons.search_outlined, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - keyboardType: TextInputType.number, - validator: - _model.textControllerValidator.asValidator(context), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9coywebh' /* Visitantes encontrados */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '6f5p0fv6' /* 24 */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ], - ), - Expanded( - child: Builder( - builder: (context) { - if (_model.visitors.isNotEmpty) { - return Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), - child: Builder( - builder: (context) { - final visitor = - _model.visitors.map((e) => e).toList(); - - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: - BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(12.0, 0.0, - 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField( - visitorItem, - r'''$.VTE_NOME''', - )?.toString(), - 'NOT FOUND', - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyLargeFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyLargeFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(4.0, 4.0, - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ], - ), - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.restore_from_trash, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - _model.removeFromVisitors( - visitorItem); - setState(() {}); - }, - ), - ], - ), - ), - ), - ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - ), - ); - } - }, - ), - ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/modals/details/schedule_visit_detail/widget.dart b/lib/modals/details/schedule_visit_detail/widget.dart deleted file mode 100644 index 60bd9005..00000000 --- a/lib/modals/details/schedule_visit_detail/widget.dart +++ /dev/null @@ -1,981 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class ScheduleVisitDetailWidget extends StatefulWidget { - const ScheduleVisitDetailWidget({ - super.key, - required this.visitorJsonList, - required this.visitorStrList, - this.visitorImgPath, - required this.visitStartDate, - required this.visitEndDate, - required this.visitResonStr, - required this.visitLevelStr, - required this.visitTempStr, - required this.visitObsStr, - }); - - final List? visitorJsonList; - final String? visitorStrList; - final String? visitorImgPath; - final String? visitStartDate; - final String? visitEndDate; - final String? visitResonStr; - final String? visitLevelStr; - final String? visitTempStr; - final String? visitObsStr; - - @override - State createState() => - _ScheduleVisitDetailWidgetState(); -} - -class _ScheduleVisitDetailWidgetState extends State { - late ScheduleVisitDetailModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ScheduleVisitDetailModel()); - - _model.textController1 ??= - TextEditingController(text: widget.visitTempStr); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= - TextEditingController(text: widget.visitStartDate); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitResonStr!)); - _model.textFieldFocusNode4 ??= FocusNode(); - - _model.textController5 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitLevelStr!)); - _model.textFieldFocusNode5 ??= FocusNode(); - - _model.textController6 ??= TextEditingController(text: widget.visitObsStr); - _model.textFieldFocusNode6 ??= FocusNode(); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Visibility( - visible: widget.visitorStrList != null && - widget.visitorStrList != '', - child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.keyboard_return, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - onPressed: () async { - Navigator.pop(context); - }, - ), - ), - ), - ), - ), - ), - Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 5.0, 0.0, 5.0, 20.0), - child: Container( - width: 100.0, - decoration: const BoxDecoration(), - child: Builder( - builder: (context) { - final visitorsData = widget.visitorJsonList! - .toList() - .take(1) - .toList(); - - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(visitorsData.length, - (visitorsDataIndex) { - final visitorsDataItem = - visitorsData[visitorsDataIndex]; - return Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(100.0), - ), - child: Align( - alignment: - const AlignmentDirectional(1.0, -1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorsDataItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 100.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ), - ), - ); - }), - ), - ); - }, - ), - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 10.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context).getText( - '7w4fohoa' /* Encerramento da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController1Validator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'snah4iet' /* Início */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '0cp1e31d' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController2Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'abppdgz3' /* Término */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'kqralft4' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'xjxhzqqm' /* Motivo da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '47oezdm6' /* Motivo */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - '2ujg7u18' /* Nível de Acesso */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '3emmbbfv' /* Nível de Acesso */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController5Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController6, - focusNode: _model.textFieldFocusNode6, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'ritce5uw' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController6Validator - .asValidator(context), - ), - ), - ), - ], - ), - Container( - width: double.infinity, - height: 22.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ] - .divide(const SizedBox(height: 30.0)) - .addToStart(const SizedBox(height: 100.0)), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.postScheduleVisit = - await PhpGroup.postScheduleVisitCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - atividade: 'putVisita', - devDesc: widget.visitObsStr, - idVisitante: widget.visitorStrList, - dtInicio: widget.visitStartDate, - dtFim: widget.visitEndDate, - unica: widget.visitTempStr, - idMotivo: - functions.extractIdToStr(widget.visitResonStr!), - idNAC: functions.extractIdToStr(widget.visitLevelStr!), - obs: widget.visitObsStr, - cliID: FFAppState().cliUUID, - ); - - if (PhpGroup.postScheduleVisitCall.error( - (_model.postScheduleVisit?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitCall.errorMsg( - (_model.postScheduleVisit?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).secondaryText, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/details/visit_details_modal/widget.dart b/lib/modals/details/visit_details_modal/widget.dart deleted file mode 100644 index 2d468235..00000000 --- a/lib/modals/details/visit_details_modal/widget.dart +++ /dev/null @@ -1,124 +0,0 @@ - - -import 'package:hub/modals/details/schedule_visit_detail/widget.dart'; -import 'package:hub/modals/details/view_visit_detail/widget.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitDetailsModalTemplateComponentWidget({ - super.key, - this.visitStatusStr, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempStr, - this.visitObsStr, - this.visitorStrList, - this.visitorJsonList, - this.visitorImgPath, - this.visitorImgList, - this.visitIdStr, - this.updateToggleIdx, - this.repeatVisitSchedule, - this.visitStatusColor, - }); - - final String? visitStatusStr; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final String? visitTempStr; - final String? visitObsStr; - final String? visitorStrList; - final List? visitorJsonList; - final String? visitorImgPath; - final List? visitorImgList; - final String? visitIdStr; - final Future Function()? updateToggleIdx; - final Future Function()? repeatVisitSchedule; - final Color? visitStatusColor; - - @override - State createState() => - _VisitDetailsModalTemplateComponentWidgetState(); -} - -class _VisitDetailsModalTemplateComponentWidgetState - extends State { - late VisitDetailsModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitDetailsModalTemplateComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Builder( - builder: (context) { - if (widget.visitStatusStr != null && widget.visitStatusStr != '') { - return wrapWithModel( - model: _model.viewVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ViewVisitDetailWidget( - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitReasonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitStatusStr: widget.visitStatusStr!, - visitorStrList: widget.visitorStrList!, - visitorJsonList: widget.visitorJsonList, - visitIdStr: widget.visitIdStr!, - visitStatusColor: widget.visitStatusColor!, - ), - ); - } else { - return wrapWithModel( - model: _model.scheduleVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ScheduleVisitDetailWidget( - visitorStrList: widget.visitorStrList!, - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitResonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitorJsonList: widget.visitorJsonList!, - ), - ); - } - }, - ), - ); - } -} diff --git a/lib/modals/details/visitor_details_modal/widget.dart b/lib/modals/details/visitor_details_modal/widget.dart deleted file mode 100644 index a52cc175..00000000 --- a/lib/modals/details/visitor_details_modal/widget.dart +++ /dev/null @@ -1,282 +0,0 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitorDetailsModalTemplateComponentWidget({super.key}); - - @override - State createState() => - _VisitorDetailsModalTemplateComponentWidgetState(); -} - -class _VisitorDetailsModalTemplateComponentWidgetState - extends State { - late VisitorDetailsModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitorDetailsModalTemplateComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(25.0), - ), - child: Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0), - child: Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 100.0, - height: 100.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kqzf7nx2' /* Nome do Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'hz7ivuqn' /* Tipo de Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rwqn0det' /* (00) 0 0000-0000 */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.email, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '0wqbiekp' /* email@provider.etc */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/modals/exceptions/not_found/widget.dart b/lib/modals/exceptions/not_found/widget.dart deleted file mode 100644 index 2a86f8bb..00000000 --- a/lib/modals/exceptions/not_found/widget.dart +++ /dev/null @@ -1,179 +0,0 @@ - -import 'package:hub/pages/registers/visitor/component.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorNotFoundComponentWidget extends StatefulWidget { - const VisitorNotFoundComponentWidget({super.key}); - - @override - State createState() => - _VisitorNotFoundComponentWidgetState(); -} - -class _VisitorNotFoundComponentWidgetState - extends State { - late VisitorNotFoundComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => VisitorNotFoundComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - width: 350.0, - height: 350.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, - ), - onPressed: () async { - Navigator.pop(context); - }, - ), - ), - ), - Icon( - Icons.notifications_none, - color: FlutterFlowTheme.of(context).accent1, - size: 72.0, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1p9mykbj' /* Usuário não encontrado */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kt937sp6' /* O documento inserido não corre... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontStyle: FontStyle.italic, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: FFButtonWidget( - onPressed: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const RegisiterVistorTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFLocalizations.of(context).getText( - 'y2x4nfcn' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/forms/forgot_password/model.dart b/lib/modals/forms/forgot_password/model.dart deleted file mode 100644 index b1d69f20..00000000 --- a/lib/modals/forms/forgot_password/model.dart +++ /dev/null @@ -1,28 +0,0 @@ - -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ForgotPasswordTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class ForgotPasswordTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. - ApiCallResponse? req; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - } -} diff --git a/lib/modals/forms/forgot_password/widget.dart b/lib/modals/forms/forgot_password/widget.dart deleted file mode 100644 index b5bbc5b7..00000000 --- a/lib/modals/forms/forgot_password/widget.dart +++ /dev/null @@ -1,313 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class ForgotPasswordTemplateComponentWidget extends StatefulWidget { - const ForgotPasswordTemplateComponentWidget({super.key}); - - @override - State createState() => - _ForgotPasswordTemplateComponentWidgetState(); -} - -class _ForgotPasswordTemplateComponentWidgetState - extends State { - late ForgotPasswordTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ForgotPasswordTemplateComponentModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText( - 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '74rnd5bu' /* Enviar */, - ), - options: FFButtonOptions( - width: 270.0, - height: 50.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: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.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, - ), - ), - showLoadingIndicator: false, - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/selection/bottom_arrow_linked_locals/widget.dart b/lib/modals/selection/bottom_arrow_linked_locals/widget.dart deleted file mode 100644 index 2bc89653..00000000 --- a/lib/modals/selection/bottom_arrow_linked_locals/widget.dart +++ /dev/null @@ -1,258 +0,0 @@ -import 'dart:developer'; - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { - const BottomArrowLinkedLocalsComponentWidget({super.key}); - - @override - State createState() => - _BottomArrowLinkedLocalsComponentWidgetState(); -} - -class _BottomArrowLinkedLocalsComponentWidgetState - extends State { - late BottomArrowLinkedLocalsComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => BottomArrowLinkedLocalsComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 150.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 150.0, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: FutureBuilder( - future: PhpGroup.getLocalsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final localsResponse = snapshot.data!; - return Builder( - builder: (context) { - final linkedLocals = PhpGroup.getLocalsCall - .locais( - localsResponse.jsonBody, - ) - ?.map((e) => e) - .toList() - .toList() ?? - []; - - return GridView.builder( - padding: EdgeInsets.zero, - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - crossAxisSpacing: 10.0, - mainAxisSpacing: 0.0, - childAspectRatio: 1.0, - ), - scrollDirection: Axis.horizontal, - itemCount: linkedLocals.length, - itemBuilder: (context, index) { - final localItem = - linkedLocals[index]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if (localItem['CLU_STATUS'] == 'A') { - - FFAppState().cliUUID = localItem['CLI_ID']; - setState(() {}); - FFAppState().local = localItem['CLI_NOME']; - setState(() {}); - FFAppState().ownerUUID = localItem['CLU_OWNER_ID']; - setState(() {}); - log('Local: ${FFAppState().local}'); - Navigator.pop(context); - } else { - log('Local não disponível'); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text( - 'Local não disponível', - ), - ), - ); - } - - }, - child: Container( - width: 50.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryText, - borderRadius: - const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - border: Border.all( - color: - FlutterFlowTheme.of(context) - .secondaryText, - width: 3.0, - ), - ), - child: ClipRRect( - borderRadius: - const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( - localItem, - r'''$.CLI_ID''', - ).toString()}.png', - width: double.infinity, - height: double.infinity, - fit: BoxFit.fill, - alignment: - const Alignment(0.0, 0.0), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Text( - getJsonField( - localItem, - r'''$.CLI_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ], - ), - ), - ); - }, - ); - }, - ); - }, - ), - ), - ], - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/pages/consults/access/model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart similarity index 74% rename from lib/pages/consults/access/model.dart rename to lib/pages/acess_history_page/acess_history_page_model.dart index cdd7163a..4d633ac2 100644 --- a/lib/pages/consults/access/model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,12 +1,13 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/modals/filters/options/widget.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; - -import 'widget.dart' show AcessHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; class AcessHistoryPageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -56,4 +57,4 @@ class AcessHistoryPageModel extends FlutterFlowModel { }, ); } -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/access/widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart similarity index 95% rename from lib/pages/consults/access/widget.dart rename to lib/pages/acess_history_page/acess_history_page_widget.dart index cec1e538..58976eb6 100644 --- a/lib/pages/consults/access/widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -3,19 +3,24 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/filters/options/widget.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; + @immutable class AcessHistoryPageWidget extends StatefulWidget { @@ -405,8 +410,8 @@ Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, decoration: BoxDecoration( color: (() { // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = functions - .jsonToStr(getJsonField( + final pesTipo = + jsonToStr(getJsonField( accessHistoryItem, r'''$.PES_TIPO''', )) @@ -548,4 +553,4 @@ String imageUrlAtomWidget(String document, String type) { "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/fastpass/widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart similarity index 98% rename from lib/pages/schedules/visit/fastpass/widget.dart rename to lib/pages/fast_pass_page/fast_pass_page_widget.dart index 36f5312f..96dfaf9a 100644 --- a/lib/pages/schedules/visit/fastpass/widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -7,7 +7,6 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'dart:io' show Platform; -import '/commons/widgets/flutter_flow_util.dart'; class FastPassPageWidget extends StatefulWidget { final String freToken = FFAppState().userUUID; @@ -95,4 +94,4 @@ class _FastPassPageWidgetState extends State { ); } -} +} \ No newline at end of file diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier b/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/home/widget.dart b/lib/pages/home/widget.dart deleted file mode 100644 index d66d6199..00000000 --- a/lib/pages/home/widget.dart +++ /dev/null @@ -1,670 +0,0 @@ -// import 'package:hub/backend/push_notification/pushNotification.dart'; -import 'dart:developer'; - -import 'package:hub/commons/actions/actions.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/atoms/local_header/widget.dart'; -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/message_well/widget.dart'; -import 'package:hub/commons/components/organisms/menu/widget.dart'; - -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import 'package:hub/pages/schedules/visit/complete/widget.dart'; -import 'package:provider/provider.dart'; - - -import '../../commons/schema/enums/enums.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'model.dart'; -export 'model.dart'; - -class HomePageWidget extends StatefulWidget { - const HomePageWidget({super.key}); - - - - - @override - State createState() => _HomePageWidgetState(); -} - -class _HomePageWidgetState extends State { - late HomePageModel _model; - bool localStatus = false; - final scaffoldKey = GlobalKey(); - - - Future checkLocalStatus() async { - localStatus = await checkLocals( - context: context, - model: _model, - safeSetState: safeSetState, - ); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => HomePageModel()); - SchedulerBinding.instance.addPostFrameCallback((_) async { - await PushNotificationService().initialize(context); - - - - - @override - void initState() { - super.initState(); - checkLocalStatus(); - } - - // Rest of your code... - if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { - showModalBottomSheet( - isScrollControlled: false, - backgroundColor: Colors.transparent, - enableDrag: false, - isDismissible: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - return; - } - }); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - - context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, - drawer: buildDrawer(context), - body: buildPage(context, localStatus), - ), - ); - } - - Container buildPage(BuildContext context, bool localStatus) { - return Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - createHeader(context), - createLocal(localStatus), - createBody(), - ], - ), - ], - ), - ), - ); - } - - Wrap createBody() { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - options: [ - - ], - expandable: true, - style: MenuView.list_grid, - item: MenuItem.button, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Provider( - create: (_) => MessageWellNotifier(), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ), - //footer - const SizedBox( - height: 100, - width: double.infinity, - ) - ], - ); - } - - Widget createLocal(bool localStatus) { - return wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: LocalProfileComponentWidget( - localStatus: localStatus, - ), - ); - } - - Row createHeader(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ), - ), - ), - ], - ), - ), - ), - ], - ); - } - - SizedBox buildDrawer(BuildContext context) { - return SizedBox( - width: 750.0, - child: Drawer( - elevation: 16.0, - child: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Container( - width: double.infinity, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Container( - width: 150.0, - child: Text( - valueOrDefault( - functions.convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito Sans'), - ), - ), - ), - ].divide(const SizedBox(width: 20.0)), - ), - ), - ), - Container( - width: 50.0, - child: Container( - height: 30.0, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Flexible( - child: FlutterFlowIconButton( - borderRadius: 100.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close_sharp, - color: FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - if (scaffoldKey.currentState! - .isDrawerOpen || - scaffoldKey.currentState! - .isEndDrawerOpen) { - Navigator.pop(context); - } - }, - ), - ), - ], - ), - ), - ), - ] - .divide(const SizedBox(width: 0.0)) - .around(const SizedBox(width: 0.0)), - ), - ), - ].addToStart(const SizedBox(height: 30.0)), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textControllerValidator - .asValidator(context), - ), - ), - ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Flexible( - child: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - options: [ - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', - ), - icon: Icons.person_add_alt_1_outlined, - ), - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitors', - ptText: 'Registrar Visitantes', - ), - icon: Icons.person_add_alt_1_outlined, - ), - - ], - expandable: false, - style: MenuView.list, - item: MenuItem.card, - ), - ), - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, - ), - borderRadius: BorderRadius.circular(50.0), - ), - ), - ].addToEnd(const SizedBox(height: 64.0)), - ), - ), - ), - ); - } -} diff --git a/lib/pages/home/model.dart b/lib/pages/home_page/home_page_model.dart similarity index 74% rename from lib/pages/home/model.dart rename to lib/pages/home_page/home_page_model.dart index dde633a3..7c227e9c 100644 --- a/lib/pages/home/model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,14 +1,10 @@ -import 'package:hub/commons/components/atoms/local_header/model.dart'; -import 'package:hub/commons/components/molecules/message_well/model.dart'; -import 'package:hub/commons/components/organisms/menu/model.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; - - - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_model.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/home_page/home_page_widget.dart'; class HomePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -50,4 +46,4 @@ class HomePageModel extends FlutterFlowModel { } -} +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_model.dart:Zone.Identifier b/lib/pages/home_page/home_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart new file mode 100644 index 00000000..6cf9f539 --- /dev/null +++ b/lib/pages/home_page/home_page_widget.dart @@ -0,0 +1,791 @@ +// import 'package:hub/backend/push_notification/pushNotification.dart'; +import 'dart:developer'; + +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.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/home_page/home_page_model.dart'; + +import 'package:provider/provider.dart'; + +class HomePageWidget extends StatefulWidget { + const HomePageWidget({super.key}); + + @override + State createState() => _HomePageWidgetState(); +} + +class _HomePageWidgetState extends State { + late HomePageModel _model; + bool localStatus = false; + final scaffoldKey = GlobalKey(); + + Future checkLocalStatus() async { + localStatus = await checkLocals( + context: context, + model: _model, + safeSetState: safeSetState, + ); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => HomePageModel()); + SchedulerBinding.instance.addPostFrameCallback((_) async { + await PushNotificationService().initialize(context); + + @override + void initState() { + super.initState(); + checkLocalStatus(); + } + + // Rest of your code... + if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { + showModalBottomSheet( + isScrollControlled: false, + backgroundColor: Colors.transparent, + enableDrag: false, + isDismissible: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } else { + return; + } + }); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, + drawer: buildDrawer(context), + body: buildPage(context, localStatus), + ), + ); + } + + Container buildPage(BuildContext context, bool localStatus) { + return Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + createHeader(context), + createLocal(localStatus), + createBody(), + ], + ), + ], + ), + ), + ); + } + + Wrap createBody() { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget( + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Provider( + create: (_) => MessageWellNotifier(), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ), + //footer + const SizedBox( + height: 100, + width: double.infinity, + ) + ], + ); + } + + Widget createLocal(bool localStatus) { + return wrapWithModel( + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: LocalProfileComponentWidget( + localStatus: localStatus, + ), + ); + } + + Row createHeader(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState!.openDrawer(); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + SizedBox buildDrawer(BuildContext context) { + return SizedBox( + width: 750.0, + child: Drawer( + elevation: 16.0, + child: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Container( + width: double.infinity, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + Container( + width: 150.0, + child: Text( + valueOrDefault( + convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito Sans'), + ), + ), + ), + ].divide(const SizedBox(width: 20.0)), + ), + ), + ), + Container( + width: 50.0, + child: Container( + height: 30.0, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: FlutterFlowIconButton( + borderRadius: 100.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close_sharp, + color: FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + onPressed: () async { + if (scaffoldKey + .currentState!.isDrawerOpen || + scaffoldKey.currentState! + .isEndDrawerOpen) { + Navigator.pop(context); + } + }, + ), + ), + ], + ), + ), + ), + ] + .divide(const SizedBox(width: 0.0)) + .around(const SizedBox(width: 0.0)), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).customColor1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), + ), + ), + ), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), + ), + Expanded( + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.card, + ), + ), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), + ), + ), + ), + ); + + // body: Container( + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryBackground, + // ), + // child: SingleChildScrollView( + // child: Column( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // child: Container( + // width: 100.0, + // height: 100.0, + // decoration: const BoxDecoration( + // color: Color(0xFF1AAB5F), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 10.0, 0.0, 0.0, 0.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: + // FlutterFlowTheme.of(context) + // .primary, + // icon: const Icon( + // Icons.menu_rounded, + // color: Colors.white, + // size: 28.0, + // ), + // onPressed: () async { + // scaffoldKey.currentState! + // .openDrawer(); + // }, + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 60.0, 15.0, 0.0, 0.0), + // child: ClipRRect( + // borderRadius: + // BorderRadius.circular(8.0), + // child: Image.network( + // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + // width: 50.0, + // height: 200.0, + // fit: BoxFit.none, + // ), + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(0.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 0.0, 15.0, 0.0, 0.0), + // child: Text( + // FFLocalizations.of(context) + // .getText( + // 'rg9pzkpz' /* FRE ACCESS */, + // ), + // style: + // FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily, + // color: FlutterFlowTheme + // .of(context) + // .info, + // letterSpacing: 0.0, + // useGoogleFonts: GoogleFonts + // .asMap() + // .containsKey( + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: 100.0, + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(1.0, 1.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // icon: Icon( + // Icons.notifications_sharp, + // color: + // FlutterFlowTheme.of(context).info, + // size: 24.0, + // ), + // onPressed: () { + // print('IconButton pressed ...'); + // }, + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // wrapWithModel( + // model: _model.localComponentModel, + // updateCallback: () => setState(() {}), + // child: const LocalProfileComponentWidget(), + // ), + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // wrapWithModel( + // model: _model.menuComponentModel, + // updateCallback: () => setState(() {}), + // child: const MenuComponentWidget(), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: wrapWithModel( + // model: _model.messageWellComponentModel, + // updateCallback: () => setState(() {}), + // child: const MessageWellComponentWidget(), + // ), + // ), + // ], + // ), + // ], + // ), + // ], + // ), + // ), + // ), + // ), + // ); + } +} diff --git a/lib/pages/home_page/home_page_widget.dart:Zone.Identifier b/lib/pages/home_page/home_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/index.dart b/lib/pages/index.dart deleted file mode 100644 index e3e432c0..00000000 --- a/lib/pages/index.dart +++ /dev/null @@ -1,8 +0,0 @@ - - -import 'consults/index.dart'; -import 'home/index.dart'; -import 'registers/index.dart'; -import 'schedules/index.dart'; -import 'settings/index.dart'; -import 'onboarding/index.dart'; \ No newline at end of file diff --git a/lib/pages/consults/liberation/model.dart b/lib/pages/liberation_history/liberation_history_model.dart similarity index 83% rename from lib/pages/consults/liberation/model.dart rename to lib/pages/liberation_history/liberation_history_model.dart index a0622162..a26534bb 100644 --- a/lib/pages/consults/liberation/model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -1,10 +1,10 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; -import 'widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/liberation_history/liberation_history_widget.dart'; class LiberationHistoryModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -45,4 +45,4 @@ class LiberationHistoryModel extends FlutterFlowModel { clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/liberation/widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart similarity index 93% rename from lib/pages/consults/liberation/widget.dart rename to lib/pages/liberation_history/liberation_history_widget.dart index 3be711e8..3627c1b4 100644 --- a/lib/pages/consults/liberation/widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -2,23 +2,25 @@ import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; + +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -253,8 +255,7 @@ Widget liberationDynamicListView( []; final filteredLiberationHistory = _model.textController.text.isNotEmpty ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( + .where((item) => jsonToStr(getJsonField( item, r'''$.VTE_NOME''', )) @@ -379,4 +380,4 @@ Widget liberationHistoryItemCard( }); }, ); -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/message/model.dart b/lib/pages/message_history_page/message_history_page_model.dart similarity index 77% rename from lib/pages/consults/message/model.dart rename to lib/pages/message_history_page/message_history_page_model.dart index a53ccc06..8d11df7b 100644 --- a/lib/pages/consults/message/model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,15 +1,16 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; - -import 'widget.dart' show MessageHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -class MessageHistoryPageModel extends FlutterFlowModel { +class MessageHistoryPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. - /// - + /// + //copyWith final unfocusNode = FocusNode(); @@ -49,7 +50,6 @@ class MessageHistoryPageModel extends FlutterFlowModel textController?.dispose(); tabBarController?.dispose(); - /// Dispose query cache managers for this widget. clearGetLiberationsCache(); diff --git a/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart similarity index 68% rename from lib/pages/consults/message/widget.dart rename to lib/pages/message_history_page/message_history_page_widget.dart index d390f66d..8d9d7d5c 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,17 +2,20 @@ import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/message_history_page/message_history_page_model.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @@ -22,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -32,7 +36,7 @@ class _MessageHistoryPageWidgetState extends State wit super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); - _model.tabBarController = TabController( + _model.tabBarController = TabController( vsync: this, length: 3, initialIndex: 1, @@ -102,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) { ); } -Widget bodyMessage( - BuildContext context, MessageHistoryPageModel _model) { +Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, child: Column( @@ -151,33 +154,26 @@ Widget bodyMessage( }, ), ), - Expanded(child: TabBarView( - controller: _model.tabBarController, - children: [ - liberationDynamicListView(context, _model, 'P'), - liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'T'), - ] - )), + Expanded( + child: TabBarView(controller: _model.tabBarController, children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ])), ].addToStart(const SizedBox(height: 0)), ), ); } - - - Widget liberationDynamicListView( - BuildContext context, - MessageHistoryPageModel _model, - String DestIndex -) { + BuildContext context, MessageHistoryPageModel _model, String DestIndex) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getMessagesCall.call( + future: PhpGroup.getMessagesCall + .call( devUUID: FFAppState().devUUID.toString(), userUUID: FFAppState().userUUID.toString(), cliID: FFAppState().cliUUID.toString(), @@ -185,7 +181,8 @@ Widget liberationDynamicListView( pageSize: '100', pageNumber: '1', tipoDestino: DestIndex, - ).catchError((error) { + ) + .catchError((error) { log('Error: ${error.toString()}'); return Future.delayed(Duration(seconds: 1), () { return Center( @@ -213,8 +210,15 @@ Widget liberationDynamicListView( child: Text('Erro ao carregar mensagens'), ); } + final mensagens = snapshot.data!.jsonBody['mensagens']; + final totalRows = snapshot.data!.jsonBody['total_rows']; + if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { + return const Center( + child: Text('Nenhuma mensagem encontrada'), + ); + } return ListView.builder( - itemCount: snapshot.data!.jsonBody['total_rows'], + itemCount: totalRows, addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, @@ -230,8 +234,7 @@ Widget liberationDynamicListView( ); } -Widget messageHistoryItem( - BuildContext context, dynamic jsonBody) { +Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -246,55 +249,60 @@ Widget messageHistoryItem( Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ) - ], - ), - SizedBox(height: 8), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, + Row( + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: FlutterFlowTheme.of(context).customColor6, + overflow: TextOverflow.ellipsis, + ), ), - overflow: TextOverflow.fade, ), - ), + ], + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + ), + ], ), ], ), SizedBox(height: 8), - Text(jsonBody['MSG_TEXTO'].toString(),), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + SizedBox(height: 8), ], ), ), ), ), ); - - } diff --git a/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/poeple/model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart similarity index 68% rename from lib/pages/consults/poeple/model.dart rename to lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 02e2d099..cc62f4f5 100644 --- a/lib/pages/consults/poeple/model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show PeopleOnThePropertyPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { @@ -16,4 +16,4 @@ class PeopleOnThePropertyPageModel void dispose() { unfocusNode.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/poeple/widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart similarity index 93% rename from lib/pages/consults/poeple/widget.dart rename to lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 313bff9f..0dbfce20 100644 --- a/lib/pages/consults/poeple/widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -1,16 +1,18 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart'; + -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); @@ -159,4 +161,4 @@ class _PeopleOnThePropertyPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart new file mode 100644 index 00000000..d7c05015 --- /dev/null +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -0,0 +1,244 @@ +import 'dart:developer'; + +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:share_plus/share_plus.dart'; + +class PreferencesPageModel with ChangeNotifier { + final unfocusNode = FocusNode(); + + Future toggleFingerprint(BuildContext context) async { + // FFAppState().checkBiometrics() + // .then((value) => FFAppState().authenticateBiometric() + // .then( (value) { + // FFAppState().fingerprint = !FFAppState().fingerprint; + + // }) + // .whenComplete(() => notifyListeners())); + + if (FFAppState().fingerprint) { + FFAppState().fingerprint = false; + FFAppState().deleteFingerprintPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + log(key); + FFAppState().fingerprintPass = key; + FFAppState().fingerprint = true; + }, + ), + ); + }, + ).whenComplete(() => notifyListeners()); + } + } + + void enablePerson(BuildContext context) { + notifyListeners(); + Share.share( + FFAppState().userDevUUID, + ); + } + + void toggleNotify(BuildContext context) { + FFAppState().notify = !FFAppState().notify; + PhpGroup.changeNotifica + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + notifica: FFAppState().notify ? 'S' : 'N', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); + notifyListeners(); + } + + void localUnlink(BuildContext context) { + PhpGroup.resopndeVinculo + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + tarefa: 'I', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + }, + ); + notifyListeners(); + } + + void deleteAccount(BuildContext context) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future togglePass(BuildContext context) async { + debugPrint('pass: ${FFAppState().pass}'); + if (FFAppState().pass) { + FFAppState().pass = false; + FFAppState().deleteAccessPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().accessPass = key; + notifyListeners(); + debugPrint('key: $key'); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().accessPass, + ) + .then((value) { + FFAppState().pass = true; + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().pass = true; + } else { + FFAppState().pass = false; + } + }).onError((error, StackTrace) { + FFAppState().pass = false; + log(error.toString()); + log(StackTrace.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + Future togglePanic(BuildContext context) async { + if (FFAppState().panic) { + FFAppState().panic = false; + FFAppState().deletePanicPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().panicPass = key; + notifyListeners(); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().panicPass, + ) + .then((value) { + FFAppState().panic = true; + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().panic = true; + } else { + FFAppState().panic = false; + } + }).onError((e, s) { + FFAppState().panic = false; + log(e.toString()); + log(s.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + @override + void dispose() { + unfocusNode.dispose(); + super.dispose(); + } +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/settings/widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart similarity index 65% rename from lib/pages/settings/widget.dart rename to lib/pages/preferences_settings_page/preferences_settings_widget.dart index fda23372..e0aa39c1 100644 --- a/lib/pages/settings/widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/pages/settings/model.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -43,7 +45,7 @@ class PreferencesPageWidget extends StatelessWidget { FFLocalizations.of(context).getVariableText( enText: 'Preferences', ptText: 'Preferências', - ), + ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -71,7 +73,7 @@ class PreferencesPageWidget extends StatelessWidget { // childAspectRatio: 1.0, // mainAxisExtent: 100.0, // ), - itemCount: 6, // 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) { @@ -87,82 +89,110 @@ class PreferencesPageWidget extends StatelessWidget { ); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + Widget _buildIconButton( + BuildContext context, int index, PreferencesPageModel model) { IconData icon; - Function() onPressed =() => {}; + Function() onPressed = () => {}; bool isEnabled; String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + onPressed = () => + model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative a autenticação por impressão digital para login seguro.', + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Ative a autenticação por impressão digital para login seguro.', enText: 'Enable fingerprint authentication for secure login.', - ); + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Exibir código de identificação remota', - enText: 'Display remote identification code', - ); + content = FFLocalizations.of(context).getVariableText( + ptText: 'Compartilhe o código de identificação remota', + enText: 'Share the remote identification code', + ); break; case 2: icon = Icons.notifications; - onPressed = model.toggleNotify; + onPressed = () => model.toggleNotify(context); isEnabled = FFAppState().notify; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para receber sua notificação de acesso', enText: 'Enable to receive your access notification', - ); + ); break; case 3: - icon = Icons.lock_clock_sharp; + icon = Icons.lock; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para inserir uma credencial de acesso para o QRCode', enText: 'Enable to enter an access credential for the QRCode', - ); + ); break; case 4: - icon = Icons.landscape; - onPressed = model.localLogout; - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para se desvincular do local selecionado', - enText: 'Enable to unlink from the selected location', - ); + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().panic; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de pânico para o QRCode', + enText: 'Enable to enter an panic credential for the QRCode', + ); break; case 5: + icon = Icons.landscape; + onPressed = () => model.localUnlink(context); + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Desative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 6: icon = Icons.delete; onPressed = () => model.deleteAccount(context); - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Delete sua conta e todos os dados associados permanentemente.', + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Delete sua conta e todos os dados associados permanentemente.', enText: 'Delete your account and all associated data permanently.', - ); + ); break; default: throw Exception('Invalid index: $index'); } - return Container( + return SizedBox( height: 100, child: GestureDetector( - onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + onTap: () { + switch (index) { + case 3: + model.togglePass(context); + break; + case 4: + model.togglePanic(context); + break; + default: + onPressed(); + } + }, child: Row( children: [ CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + backgroundColor: isEnabled + ? FlutterFlowTheme.of(context).primary + : FlutterFlowTheme.of(context).alternate, child: Icon( icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + color: isEnabled + ? FlutterFlowTheme.of(context).primaryBackground + : FlutterFlowTheme.of(context).primary, // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, // borderRadius: 20.0, @@ -178,13 +208,13 @@ class PreferencesPageWidget extends StatelessWidget { child: Text( content, style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), overflow: TextOverflow.clip, ), ), @@ -193,4 +223,4 @@ class PreferencesPageWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/qrcode/model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart similarity index 81% rename from lib/pages/consults/qrcode/model.dart rename to lib/pages/qr_code_page/qr_code_page_model.dart index d1317102..40e016ab 100644 --- a/lib/pages/consults/qrcode/model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; import 'dart:async'; -import 'widget.dart' show QrCodePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart'; class QrCodePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -29,4 +29,4 @@ class QrCodePageModel extends FlutterFlowModel { BuildContext context, { required String? key, }) async {} -} +} \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart similarity index 95% rename from lib/pages/consults/qrcode/widget.dart rename to lib/pages/qr_code_page/qr_code_page_widget.dart index c95570b3..a6994b95 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,27 +1,30 @@ import 'dart:developer'; import 'package:barcode_widget/barcode_widget.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/commons/widgets/custom_functions.dart'; +import 'package:hub/actions/actions.dart'; -import 'package:hub/modals/forms/qr_code/widget.dart'; +import 'package:hub/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.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/qr_code_page/qr_code_page_model.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; + import 'dart:async'; -import '/commons/widgets/custom_functions.dart' as functions; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; // import 'package:percent_indicator/percent_indicator.dart'; -import 'model.dart'; -export 'model.dart'; + import 'package:qr_flutter/qr_flutter.dart'; @@ -308,7 +311,7 @@ void dispose() { padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 20.0, 0.0), child: StreamBuilder( - stream: functions.getProgressValue(), + stream: getProgressValue(), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return CircularProgressIndicator(); @@ -474,4 +477,4 @@ void dispose() { elevation: 0.0, ); } -} +} \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart new file mode 100644 index 00000000..85e15627 --- /dev/null +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -0,0 +1,21 @@ +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'register_visitor_page_widget.dart' show RegisterVisitorPageWidget; +import 'package:flutter/material.dart'; + +class RegisterVisitorPageModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + late RegisiterVistorTemplateComponentModel + regisiterVistorTemplateComponentModel; + + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart new file mode 100644 index 00000000..67eae017 --- /dev/null +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -0,0 +1,83 @@ +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'register_visitor_page_model.dart'; +export 'register_visitor_page_model.dart'; + +class RegisterVisitorPageWidget extends StatefulWidget { + const RegisterVisitorPageWidget({super.key}); + + @override + State createState() => + _RegisterVisitorPageWidgetState(); +} + +class _RegisterVisitorPageWidgetState extends State { + late RegisterVisitorPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => RegisterVisitorPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + return Scaffold( + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + 'megskb6s' /* Cadastro Visitante */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: const SafeArea( + top: true, + child: RegisiterVistorTemplateComponentWidget( + source: 'RegisterVisitorPage', + )), + ); + } +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/registers/visitor/model.dart b/lib/pages/registers/visitor/model.dart deleted file mode 100644 index 7023085b..00000000 --- a/lib/pages/registers/visitor/model.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show RegisterVisitorPageWidget; -import 'package:flutter/material.dart'; - -class RegisterVisitorPageModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? scheduleVisitor; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} diff --git a/lib/pages/registers/visitor/widget.dart b/lib/pages/registers/visitor/widget.dart deleted file mode 100644 index 63b6267b..00000000 --- a/lib/pages/registers/visitor/widget.dart +++ /dev/null @@ -1,893 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; - -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/upload_data.dart'; -import '/commons/actions/index.dart' as actions; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class RegisterVisitorPageWidget extends StatefulWidget { - const RegisterVisitorPageWidget({super.key}); - - @override - State createState() => - _RegisterVisitorPageWidgetState(); -} - -class _RegisterVisitorPageWidgetState extends State { - late RegisterVisitorPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => RegisterVisitorPageModel()); - - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(); - _model.textFieldFocusNode4 ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - 'megskb6s' /* Cadastro Visitante */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: SafeArea( - top: true, - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath - .split('/') - .last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.scheduleVisitor?.jsonBody ?? - ''), - )}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), - ), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart new file mode 100644 index 00000000..23a7f0d0 --- /dev/null +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -0,0 +1,213 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +import 'package:intl/intl.dart'; + +class ScheduleCompleteVisitPageModel + extends FlutterFlowModel { + final _visitHistoryManager = FutureRequestManager(); + Future visitHistory({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _visitHistoryManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearVisitHistoryCache() => _visitHistoryManager.clear(); + void clearVisitHistoryCacheKey(String? uniqueKey) => + _visitHistoryManager.clearRequest(uniqueKey); + + /// Local state fields for this page. + + List visitorJsonList = []; + void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); + void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); + void removeAtIndexFromVisitorJsonList(int index) => + visitorJsonList.removeAt(index); + void insertAtIndexInVisitorJsonList(int index, dynamic item) => + visitorJsonList.insert(index, item); + void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => + visitorJsonList[index] = updateFn(visitorJsonList[index]); + + String visitorStrList = '0'; + bool? dropDownValidator1; + bool? dropDownValidator2; + + bool isValid() { + if ((textController1!.text != '') && + (textController2!.text != '') && + (dropDownValue1 != null && dropDownValue1 != '') && + (dropDownValue2 != null && dropDownValue2 != '')) { + return true; + } + return false; + } + + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + // State field(s) for TabBar widget. + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime endDate = + DateFormat('d/M/y H:mm:ss').parse(textController2!.text); + if (startDate.isAfter(endDate)) { + return FFLocalizations.of(context).getVariableText( + ptText: 'A data de início deve ser anterior à data de término.', + enText: 'Start date must be before end date.', + ); + } + if (startDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'Start date must be after current date.', + ptText: 'A data de início deve ser posterior à data atual.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + + DateTime? datePicked1; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime startDate = + DateFormat('d/M/y H:mm:ss').parse(textController1!.text); + if (endDate.isBefore(startDate)) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after start date.', + ptText: 'A data de término deve ser posterior à data de início.', + ); + } + if (endDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after current date.', + ptText: 'A data de término deve ser posterior à data atual.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + + DateTime? datePicked2; + // State field(s) for DropDown widget. + String? dropDownValue1; + FormFieldController? dropDownValueController1; + + // State field(s) for DropDown widget. + String? dropDownValue2; + FormFieldController? dropDownValueController2; + // State field(s) for Switch widget. + bool? switchValue; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + // if (val == null || val.isEmpty) { + // return FFLocalizations.of(context).getVariableText( + // enText: 'This field is required.', + // ptText: 'Este campo é obrigatório.', + // ); + // } + return null; + } + + @override + void initState(BuildContext context) { + tabBarController = TabController( + vsync: Navigator.of(context), + length: 2, + ); + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + } + + @override + void dispose() { + unfocusNode.dispose(); + tabBarController?.dispose(); + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + clearVisitHistoryCache(); + } + + /// Action blocks. + Future getVisitorsActionPage( + BuildContext context, { + List? visitorsJsonList, + }) async { + visitorJsonList = visitorsJsonList!.toList().cast(); + } + + Future toggleCurrentSelectionHeader( + BuildContext context, { + required bool? toggleIndexValue, + }) async { + if (toggleIndexValue == true) { + return true; + } + + return false; + } +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart new file mode 100644 index 00000000..20874759 --- /dev/null +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -0,0 +1,2219 @@ +import 'dart:developer'; + +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.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/form_field_controller.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; +import 'package:provider/provider.dart'; + +class ScheduleCompleteVisitPageWidget extends StatefulWidget { + const ScheduleCompleteVisitPageWidget({ + super.key, + this.visitorStrList, + this.visitStartDateStr, + this.visitEndDateStr, + this.visitReasonStr, + this.visitLevelStr, + this.visitTempBol, + this.visitObsStr, + this.visitorJsonList, + }); + + final String? visitorStrList; + final String? visitStartDateStr; + final String? visitEndDateStr; + final String? visitReasonStr; + final String? visitLevelStr; + final bool? visitTempBol; + final String? visitObsStr; + final List? visitorJsonList; + + @override + State createState() => + _ScheduleCompleteVisitPageWidgetState(); +} + +class _ScheduleCompleteVisitPageWidgetState + extends State + with TickerProviderStateMixin { + late ScheduleCompleteVisitPageModel _model; + int _visitHistoryLoadingIdx = 0; + final int _visitHistoryLoadingCount = 10; + List _visitHistoryList = []; + ScrollController _visitHistoryController = ScrollController(); + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ScheduleCompleteVisitPageModel()); + + // On page load action. + SchedulerBinding.instance.addPostFrameCallback((_) async { + if ((widget.visitorStrList != null && widget.visitorStrList != '') && + ((widget.visitorJsonList != null && + (widget.visitorJsonList)!.isNotEmpty) != + null)) { + _model.visitorJsonList = widget.visitorJsonList! + .where((e) => + widget.visitorStrList == + getJsonField( + e, + r'''$.VTE_DOCUMENTO''', + ).toString().toString()) + .toList() + .toList() + .cast(); + _model.visitorStrList = widget.visitorStrList!; + setState(() {}); + } else { + return; + } + }); + + _model.tabBarController = TabController( + vsync: this, + length: 2, + initialIndex: 0, + )..addListener(() => setState(() {})); + _model.textController1 ??= TextEditingController(); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= TextEditingController(); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.switchValue = true; + _model.textController3 ??= TextEditingController(); + _model.textFieldFocusNode3 ??= FocusNode(); + } + + void _loadMoreVisitHistory() async { + // Simulate fetching data from an API or database + Future> fetchVisitHistory(int start, int limit) async { + // Simulate network delay + await Future.delayed(const Duration(seconds: 1)); + // Generate a list of visit history items + return List.generate(limit, (index) => "Item ${start + index}"); + } + + // Calculate the start index for the next batch of items to load + final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; + // Fetch the next batch of items + final List newItems = + await fetchVisitHistory(start, _visitHistoryLoadingCount); + + // If new items were fetched, add them to the list and update the index + if (newItems.isNotEmpty) { + _visitHistoryList.addAll(newItems); + _visitHistoryLoadingIdx++; + setState(() {}); + } + } + + void_scrollListener() { + if (_visitHistoryController.position.pixels == + _visitHistoryController.position.maxScrollExtent) { + _loadMoreVisitHistory(); + } + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarScheduleCompleteVisit(context), + body: + bodyScheduleCompleteVisit(context, _model, setState, safeSetState), + ), + ); + } +} + +PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + elevation: 0.0, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + '61lcxdgm' /* Agendar Visita */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); +} + +Widget bodyScheduleCompleteVisit( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function setState, + Function safeSetState) { + return SafeArea( + top: true, + child: Column( + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getText( + 'ueth1f4g' /* Cadastrar Visita */, + ), + ), + Tab( + text: FFLocalizations.of(context).getText( + 'k4uraqam' /* Histórico de Visitas */, + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded( + child: TabBarView( + controller: _model.tabBarController, + children: [ + scheduleVisit(context, _model, setState, safeSetState), + visitHistory(context, _model, safeSetState), + ], + ), + ), + ], + ), + ); +} + +Widget scheduleVisit( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function setState, + Function safeSetState) { + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe' /* Qual o período de validade da ... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + readOnly: true, + focusNode: _model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + '53cbwqh9' /* Quando você inicia a visita? */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController1Validator + .asValidator(context)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + _model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + setState(() { + _model.textController1?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController1?.selection = + TextSelection.collapsed( + offset: _model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + readOnly: true, + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'xpgc5e8d' /* Quando a visita terminá? */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + _model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + setState(() { + _model.textController2?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController2?.selection = + TextSelection.collapsed( + offset: _model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ] + // .divide(const SizedBox(height: 0.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u' /* Quais são os motivos da visita... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final reasonsJsonList = + PhpGroup.getDadosCall.reasonsJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + controller: + _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= '', + ), + options: reasonsJsonList != null && + reasonsJsonList != [] + ? List.from( + PhpGroup.getDadosCall + .reasonsJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .reasonsMotDescStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr' /* Escolha um motivo aqui */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final lavelList = + PhpGroup.getDadosCall.levelJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= '', + ), + options: + lavelList != null && lavelList != [] + ? List.from(lavelList! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .levelNACDescricaoStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c' /* Escolha um nível de acesso aqu... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1' /* Visita se encerra após o prime... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht' /* Visita única */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Switch.adaptive( + value: _model.switchValue!, + onChanged: (newValue) async { + setState(() => _model.switchValue = newValue); + }, + applyCupertinoTheme: false, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } + return FlutterFlowTheme.of(context).alternate; + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, + ), + ], + ), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c' /* Você tem alguma observação sob... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm' /* Escreva as suas observações aq... */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ), + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], + ), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), + onPressed: _model.isValid() + ? () async { + await showDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height * 0.7, + child: VisitDetailsModalTemplateComponentWidget( + visitStartDateStr: _model.textController1.text, + visitEndDateStr: _model.textController2.text, + visitReasonStr: _model.dropDownValue1, + visitLevelStr: _model.dropDownValue2, + visitTempStr: + _model.switchValue == true ? 'Sim' : 'Não', + visitObsStr: _model.textController3.text, + visitorStrList: _model.visitorStrList, + visitorJsonList: _model.visitorJsonList, + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), + ].addToEnd(const SizedBox(height: 30.0)), + ), + ); +} + +Widget visitHistory( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function safeSetState, +) { + return Container( + width: double.infinity, + height: 900.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.settings_sharp, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ], + ), + FutureBuilder( + future: _model.visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const BouncingScrollPhysics(), + addAutomaticKeepAlives: true, + cacheExtent: 1000.0, + addRepaintBoundaries: true, + addSemanticIndexes: true, + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + // visitaWrap.length, (visitaWrapIndex) { + + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + useSafeArea: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => + _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitStatusColor: getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString() == + 'A' + ? FlutterFlowTheme.of(context).success + : FlutterFlowTheme.of(context).error, + visitorJsonList: + PhpGroup.getVisitsCall.visitasList( + wrapGetVisitsResponse.jsonBody, + ), + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + color: + FlutterFlowTheme.of(context).primaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context) + .getText( + 'i46frqyi' /* Visitante: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of(context) + .getText( + '73b1kj59' /* Início em: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Text( + getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of(context) + .getText( + 'klzzrfbn' /* Fim em: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Text( + getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Container( + width: 200.0, + height: 27.0, + decoration: BoxDecoration( + color: valueOrDefault( + () { + if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme + .of(context) + .success; + } else if ((jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FlutterFlowTheme + .of(context) + .error; + } else if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme + .of(context) + .warning; + } else { + return FlutterFlowTheme + .of(context) + .primary; + } + }(), + FlutterFlowTheme.of(context) + .primary, + ), + borderRadius: + BorderRadius.circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + () { + if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Ativo', + enText: 'Active', + ); + } else if ((jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ); + } else { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ); + } + }(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme + .of(context) + .info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ].divide(const SizedBox(height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ); + }); + }, + ); + }, + ) + ], + ), + ), + ); +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/provisional/model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart similarity index 90% rename from lib/pages/schedules/visit/provisional/model.dart rename to lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 9fe405f5..8baf87a9 100644 --- a/lib/pages/schedules/visit/provisional/model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -1,9 +1,9 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ScheduleProvisionalVisitPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart'; class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { @@ -62,4 +62,4 @@ class ScheduleProvisionalVisitPageModel textFieldFocusNode3?.dispose(); textController3?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/provisional/widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart similarity index 98% rename from lib/pages/schedules/visit/provisional/widget.dart rename to lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 52dee3ab..6200de1c 100644 --- a/lib/pages/schedules/visit/provisional/widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,19 +1,22 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.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/nav/nav.dart'; + -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); @@ -865,4 +868,4 @@ class _ScheduleProvisionalVisitPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/complete/model.dart b/lib/pages/schedules/visit/complete/model.dart deleted file mode 100644 index d2ce64db..00000000 --- a/lib/pages/schedules/visit/complete/model.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' - show ScheduleCompleteVisitPageWidget; -import 'package:flutter/material.dart'; - -class ScheduleCompleteVisitPageModel - extends FlutterFlowModel { - final _visitHistoryManager = FutureRequestManager(); - Future visitHistory({ - String? uniqueQueryKey, - bool? overrideCache, - required Future Function() requestFn, - }) => - _visitHistoryManager.performRequest( - uniqueQueryKey: uniqueQueryKey, - overrideCache: overrideCache, - requestFn: requestFn, - ); - void clearVisitHistoryCache() => _visitHistoryManager.clear(); - void clearVisitHistoryCacheKey(String? uniqueKey) => - _visitHistoryManager.clearRequest(uniqueKey); - - /// Local state fields for this page. - - List visitorJsonList = []; - void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); - void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); - void removeAtIndexFromVisitorJsonList(int index) => - visitorJsonList.removeAt(index); - void insertAtIndexInVisitorJsonList(int index, dynamic item) => - visitorJsonList.insert(index, item); - void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => - visitorJsonList[index] = updateFn(visitorJsonList[index]); - - String visitorStrList = '0'; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - // State field(s) for TabBar widget. - TabController? tabBarController; - int get tabBarCurrentIndex => - tabBarController != null ? tabBarController!.index : 0; - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - DateTime? datePicked1; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - DateTime? datePicked2; - // State field(s) for DropDown widget. - String? dropDownValue1; - FormFieldController? dropDownValueController1; - // State field(s) for DropDown widget. - String? dropDownValue2; - FormFieldController? dropDownValueController2; - // State field(s) for Switch widget. - bool? switchValue; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - tabBarController?.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - clearVisitHistoryCache(); - } - - /// Action blocks. - Future getVisitorsActionPage( - BuildContext context, { - List? visitorsJsonList, - }) async { - visitorJsonList = visitorsJsonList!.toList().cast(); - } - - Future toggleCurrentSelectionHeader( - BuildContext context, { - required bool? toggleIndexValue, - }) async { - if (toggleIndexValue == true) { - return true; - } - - return false; - } -} \ No newline at end of file diff --git a/lib/pages/schedules/visit/complete/widget.dart b/lib/pages/schedules/visit/complete/widget.dart deleted file mode 100644 index 7dbda87d..00000000 --- a/lib/pages/schedules/visit/complete/widget.dart +++ /dev/null @@ -1,2365 +0,0 @@ -import 'dart:developer'; - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/browsers/visitor_browser/widget.dart'; -import 'package:hub/modals/details/visit_details_modal/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class ScheduleCompleteVisitPageWidget extends StatefulWidget { - const ScheduleCompleteVisitPageWidget({ - super.key, - this.visitorStrList, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempBol, - this.visitObsStr, - this.visitorJsonList, - }); - - final String? visitorStrList; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final bool? visitTempBol; - final String? visitObsStr; - final List? visitorJsonList; - - @override - State createState() => - _ScheduleCompleteVisitPageWidgetState(); -} - -class _ScheduleCompleteVisitPageWidgetState - extends State - with TickerProviderStateMixin { - late ScheduleCompleteVisitPageModel _model; - int _visitHistoryLoadingIdx = 0; - final int _visitHistoryLoadingCount = 10; - List _visitHistoryList = []; - ScrollController _visitHistoryController = ScrollController(); - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ScheduleCompleteVisitPageModel()); - - // On page load action. - SchedulerBinding.instance.addPostFrameCallback((_) async { - if ((widget.visitorStrList != null && widget.visitorStrList != '') && - ((widget.visitorJsonList != null && - (widget.visitorJsonList)!.isNotEmpty) != - null)) { - _model.visitorJsonList = widget.visitorJsonList! - .where((e) => - widget.visitorStrList == - getJsonField( - e, - r'''$.VTE_DOCUMENTO''', - ).toString().toString()) - .toList() - .toList() - .cast(); - _model.visitorStrList = widget.visitorStrList!; - setState(() {}); - } else { - return; - } - }); - - _model.tabBarController = TabController( - vsync: this, - length: 2, - initialIndex: 0, - )..addListener(() => setState(() {})); - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.switchValue = true; - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - } - - void _loadMoreVisitHistory() async { - // Simulate fetching data from an API or database - Future> fetchVisitHistory(int start, int limit) async { - // Simulate network delay - await Future.delayed(Duration(seconds: 1)); - // Generate a list of visit history items - return List.generate(limit, (index) => "Item ${start + index}"); - } - - // Calculate the start index for the next batch of items to load - final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; - // Fetch the next batch of items - final List newItems = - await fetchVisitHistory(start, _visitHistoryLoadingCount); - - // If new items were fetched, add them to the list and update the index - if (newItems.isNotEmpty) { - _visitHistoryList.addAll(newItems); - _visitHistoryLoadingIdx++; - setState(() {}); - } - } - - void_scrollListener() { - if (_visitHistoryController.position.pixels == - _visitHistoryController.position.maxScrollExtent) { - _loadMoreVisitHistory(); - } - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarScheduleCompleteVisit(context), - body: - bodyScheduleCompleteVisit(context, _model, setState, safeSetState), - ), - ); - } -} - - -PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - elevation: 0.0, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '61lcxdgm' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyScheduleCompleteVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { - return SafeArea( - top: true, - child: Column( - children: [ - Align( - alignment: const Alignment(0.0, 0), - child: TabBar( - labelColor: FlutterFlowTheme.of(context).primaryText, - unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, - labelStyle: FlutterFlowTheme.of(context).titleMedium.override( - fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleMediumFamily), - ), - unselectedLabelStyle: const TextStyle(), - indicatorColor: FlutterFlowTheme.of(context).primary, - padding: const EdgeInsets.all(4.0), - tabs: [ - Tab( - text: FFLocalizations.of(context).getText( - 'ueth1f4g' /* Cadastrar Visita */, - ), - ), - Tab( - text: FFLocalizations.of(context).getText( - 'k4uraqam' /* Histórico de Visitas */, - ), - ), - ], - controller: _model.tabBarController, - onTap: (i) async { - [() async {}, () async {}][i](); - }, - ), - ), - Expanded( - child: TabBarView( - controller: _model.tabBarController, - children: [ - scheduleVisit(context, _model, setState, safeSetState), - visitHistory(context, _model, safeSetState), - ], - ), - ), - ], - ), - ); -} - -Widget scheduleVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Stack( - children: [ - Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 0, - 20.0, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - _model.removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - child: Container( - width: 100.0, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_TIPO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart( - const SizedBox(width: 30.0)), - ), - ), - ); - }, - ); - }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - functions.strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: - MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent4, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - '53cbwqh9' /* Quando você inicia a visita? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked1Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - _model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - setState(() { - _model.textController1?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked1, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController1 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController1! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 55.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - 'xpgc5e8d' /* Quando a visita terminá? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked2Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked2Date != null && - datePicked2Time != null) { - safeSetState(() { - _model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - setState(() { - _model.textController2?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked2, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController2 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController2! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 39.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u' /* Quais são os motivos da visita... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr' /* Escolha um motivo aqui */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .levelJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c' /* Escolha um nível de acesso aqu... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1' /* Visita se encerra após o prime... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht' /* Visita única */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch.adaptive( - value: _model.switchValue!, - onChanged: (newValue) async { - setState(() => _model.switchValue = newValue); - }, - activeColor: - FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'eftcs67c' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'w18iztdm' /* Escreva as suas observações aq... */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], - ), - ), - ), - ], - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if ((_model.textController1.text != '') && - (_model.textController2.text != '') && - (_model.dropDownValue1 != null && - _model.dropDownValue1 != '') && - (_model.dropDownValue2 != null && - _model.dropDownValue2 != '')) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: VisitDetailsModalTemplateComponentWidget( - visitStartDateStr: _model.textController1.text, - visitEndDateStr: _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: - _model.switchValue == true ? 'Sim' : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const ThrowExceptionWidget( - msg: 'Campos obrigatórios imcompletos.', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width * 0.5, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(10.0), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - ), - ), - ), - ].addToEnd(const SizedBox(height: 30.0)), - ), - ); -} - -Widget visitHistory( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function safeSetState, -) { - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ], - ), - FutureBuilder( - future: _model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - ), - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - // visitaWrap.length, (visitaWrapIndex) { - - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - useSafeArea: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: getJsonField( - visitaWrapItem, - r'''$.VAW_OBS''', - ).toString(), - visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - visitorStrList: getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitStatusColor: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString() == - 'A' - ? FlutterFlowTheme.of(context).success - : FlutterFlowTheme.of(context).error, - visitorJsonList: - PhpGroup.getVisitsCall.visitasList( - wrapGetVisitsResponse.jsonBody, - ), - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Card( - clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'i46frqyi' /* Visitante: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - '73b1kj59' /* Início em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'klzzrfbn' /* Fim em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme - .of(context) - .success; - } else if ((functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FlutterFlowTheme - .of(context) - .error; - } else if (functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme - .of(context) - .warning; - } else { - return FlutterFlowTheme - .of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - () { - if (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Ativo', - enText: 'Active', - ); - } else if ((functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ); - } else { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ), - ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - ], - ), - ), - ), - ); - }); - }, - ); - }, - ) - ], - ), - ), - ); - - -} \ No newline at end of file diff --git a/lib/pages/settings/model.dart b/lib/pages/settings/model.dart deleted file mode 100644 index 7f78258f..00000000 --- a/lib/pages/settings/model.dart +++ /dev/null @@ -1,170 +0,0 @@ - -import 'dart:developer'; - - -// import 'package:hub/commons/actions/api_calls.dart'; -// import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -// import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:hub/modals/forms/change_password/widget.dart'; - -class PreferencesPageModel with ChangeNotifier { - final unfocusNode = FocusNode(); - - - Future toggleFingerprint(BuildContext context) async { - - // FFAppState().checkBiometrics() - // .then((value) => FFAppState().authenticateBiometric() - // .then( (value) { - // FFAppState().fingerprint = !FFAppState().fingerprint; - - // }) - // .whenComplete(() => notifyListeners())); - - if(FFAppState().fingerprint) { - FFAppState().fingerprint = false; - FFAppState().deleteFingerprintPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - log(key); - FFAppState().fingerprintPass = key; - FFAppState().fingerprint = true; - }, - ), - ); - }, - ).whenComplete(() => notifyListeners()); - } - - } - - void enablePerson(BuildContext context) { - - notifyListeners(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(FFAppState().userDevUUID, style: TextStyle(color: FlutterFlowTheme.of(context).info) ), - backgroundColor: FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 1), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - } - - void toggleNotify() { - FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - notifica: FFAppState().notify ? 'S' : 'N', - ); - notifyListeners(); - } - - void localLogout(){ - PhpGroup.resopndeVinculo.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - tarefa: 'I', - ); - notifyListeners(); - } - - void deleteAccount(BuildContext context) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - - Future togglePass(BuildContext context) async { - debugPrint('pass: ${FFAppState().pass}'); - if(FFAppState().pass) { - FFAppState().pass = false; - FFAppState().deleteAccessPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().accessPass = key; - notifyListeners(); - debugPrint('key: $key'); - await PhpGroup.changePass.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - newSenha: FFAppState().accessPass, - ) - .then((value) { - FFAppState().pass = true; - // var error = jsonDecode(value.jsonBody['error'].toString()); - // log('${jsonDecode(value.jsonBody['error'].toString())}'); - if(jsonDecode(value.jsonBody['error'].toString()) == false) { - FFAppState().pass = true; - } else { - FFAppState().pass = false; - } - }) - .onError((error, StackTrace) { - FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); - }) - .whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); - } - } - - @override - void dispose() { - unfocusNode.dispose(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/pages/onboarding/signin/model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart similarity index 73% rename from lib/pages/onboarding/signin/model.dart rename to lib/pages/sign_in_page/sign_in_page_model.dart index c5f0d901..6cea2517 100644 --- a/lib/pages/onboarding/signin/model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/pages/onboarding/signin/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show SignInPageWidget; +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_in_page_widget.dart' show SignInPageWidget; import 'package:flutter/material.dart'; class SignInPageModel extends FlutterFlowModel { @@ -22,4 +21,4 @@ class SignInPageModel extends FlutterFlowModel { unfocusNode.dispose(); signInTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signin/widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart similarity index 81% rename from lib/pages/onboarding/signin/widget.dart rename to lib/pages/sign_in_page/sign_in_page_widget.dart index b450d0da..23b13170 100644 --- a/lib/pages/onboarding/signin/widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -1,11 +1,10 @@ -import 'package:hub/pages/onboarding/signin/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'sign_in_page_model.dart'; +export 'sign_in_page_model.dart'; class SignInPageWidget extends StatefulWidget { const SignInPageWidget({super.key}); @@ -57,4 +56,4 @@ class _SignInPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart similarity index 73% rename from lib/pages/onboarding/signup/model.dart rename to lib/pages/sign_up_page/sign_up_page_model.dart index 94958f8b..349ee990 100644 --- a/lib/pages/onboarding/signup/model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -1,8 +1,6 @@ - -import 'package:hub/pages/onboarding/signup/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show SignUpPageWidget; +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_up_page_widget.dart' show SignUpPageWidget; import 'package:flutter/material.dart'; class SignUpPageModel extends FlutterFlowModel { @@ -23,4 +21,4 @@ class SignUpPageModel extends FlutterFlowModel { unfocusNode.dispose(); signUpTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart similarity index 81% rename from lib/pages/onboarding/signup/widget.dart rename to lib/pages/sign_up_page/sign_up_page_widget.dart index a0a9c30a..8d68605b 100644 --- a/lib/pages/onboarding/signup/widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -1,11 +1,10 @@ -import 'package:hub/pages/onboarding/signup/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'sign_up_page_model.dart'; +export 'sign_up_page_model.dart'; class SignUpPageWidget extends StatefulWidget { const SignUpPageWidget({super.key}); @@ -58,4 +57,4 @@ class _SignUpPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart new file mode 100644 index 00000000..c8e9cc15 --- /dev/null +++ b/lib/pages/test_page/test_page.dart @@ -0,0 +1,63 @@ +// import 'dart:developer'; + +// import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +// import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; +// import 'package:flutter/material.dart'; + +// class TestPage extends StatelessWidget { +// const TestPage({Key? key}) : super(key: key); + +// @override +// Widget build(BuildContext context) { +// // Exemplo de dados para os HashMaps +// final Map labelsHashMap = { +// 'Nome:': 'Gabriel da Silva', +// 'Entrada:': '08:00 AM 01/01/2022', +// 'Saída:': '17:00 PM 01/01/2022', +// }; + +// // Ajuste para o novo tipo esperado pelo componente +// final Map statusHashMap = { +// 'Ativo': FlutterFlowTheme.of(context).success, +// }; + +// // função set statusHashMap que recebe um String status faz um switch case e retorna um Map +// Map getStatusHashMap(String status) { +// switch (status) { +// case 'Ativo': +// return {'Ativo': FlutterFlowTheme.of(context).success}; +// case 'Inativo': +// return {'Inativo': FlutterFlowTheme.of(context).error}; +// default: +// return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; +// } +// } + +// // Ajuste para passar os valores corretos para a URL da imagem +// final Map imageKeyValue = { +// 'key': 'docID', +// 'value': 'imageType', +// }; + +// return Scaffold( +// appBar: AppBar( +// title: const Text('Test Page'), +// ), +// body: Center( +// child: ListView.builder( +// itemCount: 10, +// itemBuilder: (context, index) { +// return CardItemTemplateComponentWidget( +// labelsHashMap: labelsHashMap, +// statusHashMap: statusHashMap, +// imageHashMap: imageKeyValue, +// onTapCardItemAction: () async { +// // Ação ao tocar no card +// log('Card tapped'); +// }, +// ); +// }), +// ), +// ); +// } +// } diff --git a/lib/pages/test_page/test_page.dart:Zone.Identifier b/lib/pages/test_page/test_page.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/visit/model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart similarity index 91% rename from lib/pages/consults/visit/model.dart rename to lib/pages/visit_history_page/visit_history_page_model.dart index c334b012..c0c3bed8 100644 --- a/lib/pages/consults/visit/model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,10 +1,11 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; -import 'package:flutter/material.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show VisitHistoryPageWidget; + +import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; class VisitHistoryPageModel extends FlutterFlowModel { final _visitHistoryManager = FutureRequestManager(); @@ -104,4 +105,4 @@ class VisitHistoryPageModel extends FlutterFlowModel { return false; } -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/visit/widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart similarity index 96% rename from lib/pages/consults/visit/widget.dart rename to lib/pages/visit_history_page/visit_history_page_widget.dart index f04af3ed..3e813f39 100644 --- a/lib/pages/consults/visit/widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -5,16 +5,18 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/modals/details/visit_details_modal/widget.dart'; -import 'package:hub/pages/consults/visit/model.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ @@ -328,10 +330,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -575,7 +577,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -584,26 +586,26 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -612,8 +614,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -641,7 +643,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -653,26 +655,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -752,4 +754,4 @@ Widget visitHistory( ), ), ); -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/model.dart b/lib/pages/welcome_page/welcome_page_model.dart similarity index 75% rename from lib/pages/onboarding/welcome/model.dart rename to lib/pages/welcome_page/welcome_page_model.dart index 2ad92294..4c08929e 100644 --- a/lib/pages/onboarding/welcome/model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/pages/onboarding/welcome/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show WelcomePageWidget; +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'welcome_page_widget.dart' show WelcomePageWidget; import 'package:flutter/material.dart'; class WelcomePageModel extends FlutterFlowModel { @@ -26,4 +25,4 @@ class WelcomePageModel extends FlutterFlowModel { unfocusNode.dispose(); welcomeTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart similarity index 86% rename from lib/pages/onboarding/welcome/widget.dart rename to lib/pages/welcome_page/welcome_page_widget.dart index af1a8f7d..5ec8a486 100644 --- a/lib/pages/onboarding/welcome/widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -1,13 +1,12 @@ -import 'package:hub/pages/onboarding/welcome/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'welcome_page_model.dart'; +export 'welcome_page_model.dart'; class WelcomePageWidget extends StatefulWidget { const WelcomePageWidget({super.key}); @@ -78,4 +77,4 @@ class _WelcomePageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart b/lib/shared/components/atoms/atom_terms_of_use.dart new file mode 100644 index 00000000..e1f29b9b --- /dev/null +++ b/lib/shared/components/atoms/atom_terms_of_use.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +import '../../../flutter_flow/flutter_flow_theme.dart'; +import '../../../flutter_flow/flutter_flow_util.dart'; + +class AtomTermsOfUse extends StatelessWidget { + + const AtomTermsOfUse({super.key}); + + @override + Widget build(BuildContext context) { + return InkWell( + child: Text( + FFLocalizations.of(context).getText( + 'olf967cj' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + onTap: () => launchURL('https://freaccess.com.br/pp'), + ); + } +} \ No newline at end of file diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier b/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/enums/enum_throw_exception.dart b/lib/shared/enums/enum_throw_exception.dart new file mode 100644 index 00000000..f1bf2a08 --- /dev/null +++ b/lib/shared/enums/enum_throw_exception.dart @@ -0,0 +1,5 @@ +enum EnumThrowException { + success, + error, + warning +} \ No newline at end of file diff --git a/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier b/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart new file mode 100644 index 00000000..6db1ed89 --- /dev/null +++ b/lib/shared/utils/dialog_util.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/enums/enum_throw_exception.dart'; + +class DialogUtil { + static const double _height = 350; + + static Future errorDefault(BuildContext context) { + return error(context, FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later." + )); + } + + static Future error(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error)) + ) + ); + } + ); + } + + static Future warning(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning)) + ) + ); + } + ); + } + + static Future success(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success)) + ) + ); + } + ); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/dialog_util.dart:Zone.Identifier b/lib/shared/utils/dialog_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/log_util.dart b/lib/shared/utils/log_util.dart new file mode 100644 index 00000000..64a30e12 --- /dev/null +++ b/lib/shared/utils/log_util.dart @@ -0,0 +1,15 @@ +import 'dart:developer'; + +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +class LogUtil { + + static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { + FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); + FirebaseCrashlytics.instance.setCustomKey('Body', body); + + await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/log_util.dart:Zone.Identifier b/lib/shared/utils/log_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/validator_util.dart b/lib/shared/utils/validator_util.dart new file mode 100644 index 00000000..3188c18e --- /dev/null +++ b/lib/shared/utils/validator_util.dart @@ -0,0 +1,17 @@ +class ValidatorUtil { + static bool isValidEmail(String email) { + if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) { + return true; + } else { + return false; + } + } + + static bool isValidPassword(String password) { + if (password.length >= 8) { + return true; + } else { + return false; + } + } +} diff --git a/lib/shared/utils/validator_util.dart:Zone.Identifier b/lib/shared/utils/validator_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/pubspec.lock b/pubspec.lock index a64d3263..db941ddb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,6 +345,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.17.2" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + sha256: ad7510d9bcf1f40fc895944942f553a4c5603acb4715c0d6386dd587f82f6ae5 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + sha256: "318589f1da3bb858872002fa20170234566f0fb080669a8256c85a81513a802a" + url: "https://pub.dev" + source: hosted + version: "3.6.37" firebase_messaging: dependency: "direct main" description: diff --git a/pubspec.lock:Zone.Identifier b/pubspec.lock:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/pubspec.yaml b/pubspec.yaml index 9df0cbc2..8efce314 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,6 +107,7 @@ dependencies: flutter_riverpod: ^2.5.1 qr_flutter: ^4.1.0 permission_handler: ^11.3.1 + firebase_crashlytics: ^4.0.1 dependency_overrides: http: 1.2.1 @@ -198,4 +199,3 @@ flutter: # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages - diff --git a/pubspec.yaml:Zone.Identifier b/pubspec.yaml:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/test/widget_test.dart b/test/widget_test.dart index fce5c632..76de18a9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,17 +1,17 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. +// // This is a basic Flutter widget test. +// // +// // To perform an interaction with a widget in your test, use the WidgetTester +// // utility that Flutter provides. For example, you can send tap and scroll +// // gestures. You can also use WidgetTester to find child widgets in the widget +// // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter_test/flutter_test.dart'; +// import 'package:flutter_test/flutter_test.dart'; -import 'package:hub/main.dart'; +// import 'package:f_r_e_hub/main.dart'; -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - }); -} +// void main() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(MyApp()); +// }); +// } diff --git a/test/widget_test.dart:Zone.Identifier b/test/widget_test.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/favicon.png:Zone.Identifier b/web/favicon.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/Icon-192.png:Zone.Identifier b/web/icons/Icon-192.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/Icon-512.png:Zone.Identifier b/web/icons/Icon-512.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/app_launcher_icon.svg:Zone.Identifier b/web/icons/app_launcher_icon.svg:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/index.html:Zone.Identifier b/web/index.html:Zone.Identifier new file mode 100644 index 00000000..e69de29b From 6f3b98ed69e6416e3c183185a4b852afbe9e1cca Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 5 Aug 2024 09:26:27 -0300 Subject: [PATCH 25/72] Fix Message Notification Dialog & Delete and Unlink AlertDialog --- .tool-versions:Zone.Identifier | 0 README.md:Zone.Identifier | 0 analysis_options.yaml:Zone.Identifier | 0 android/.gitignore:Zone.Identifier | 0 android/app/build.gradle:Zone.Identifier | 0 .../app/google-services.json:Zone.Identifier | 0 .../debug/AndroidManifest.xml:Zone.Identifier | 0 .../main/AndroidManifest.xml:Zone.Identifier | 0 .../MainActivity.kt:Zone.Identifier | 0 .../drawable/ic_fre_black.png:Zone.Identifier | 0 .../launch_background.xml:Zone.Identifier | 0 .../mipmap/ic_fre_black.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../ic_fre_black.png:Zone.Identifier | 0 .../ic_launcher.png:Zone.Identifier | 0 .../styles.xml:Zone.Identifier | 0 .../values-night/styles.xml:Zone.Identifier | 0 .../res/values-v31/styles.xml:Zone.Identifier | 0 .../res/values/strings.xml:Zone.Identifier | 0 .../res/values/styles.xml:Zone.Identifier | 0 .../AndroidManifest.xml:Zone.Identifier | 0 android/build.gradle:Zone.Identifier | 0 android/gradle.properties:Zone.Identifier | 0 .../gradle-wrapper.properties:Zone.Identifier | 0 android/settings.gradle:Zone.Identifier | 0 assets/audios/favicon.png:Zone.Identifier | 0 .../fonts/Nunito-Medium.ttf:Zone.Identifier | 0 .../fonts/Nunito-Regular.ttf:Zone.Identifier | 0 .../SFPRODISPLAYBOLD.OTF:Zone.Identifier | 0 .../SFPRODISPLAYMEDIUM.OTF:Zone.Identifier | 0 .../SFPRODISPLAYREGULAR.OTF:Zone.Identifier | 0 assets/fonts/favicon.png:Zone.Identifier | 0 assets/fonts/icons.ttf:Zone.Identifier | 0 assets/fonts/menu.ttf:Zone.Identifier | 0 ...aptive_background_icon.svg:Zone.Identifier | 0 ...aptive_foreground_icon.svg:Zone.Identifier | 0 .../app_launcher_icon.svg:Zone.Identifier | 0 assets/images/dark/login.svg:Zone.Identifier | 0 .../images/dark/register.svg:Zone.Identifier | 0 .../images/dark/welcome.svg:Zone.Identifier | 0 assets/images/error_image.svg:Zone.Identifier | 0 assets/images/favicon.png:Zone.Identifier | 0 assets/images/light/login.svg:Zone.Identifier | 0 .../images/light/register.svg:Zone.Identifier | 0 .../images/light/welcome.svg:Zone.Identifier | 0 assets/images/logo.svg:Zone.Identifier | 0 .../favicon.png:Zone.Identifier | 0 assets/pdfs/favicon.png:Zone.Identifier | 0 .../favicon.png:Zone.Identifier | 0 assets/videos/favicon.png:Zone.Identifier | 0 devtools_options.yaml:Zone.Identifier | 0 firebase.json:Zone.Identifier | 0 ios/.gitignore:Zone.Identifier | 0 .../AppFrameworkInfo.plist:Zone.Identifier | 0 ios/Flutter/Debug.xcconfig:Zone.Identifier | 0 ios/Flutter/Release.xcconfig:Zone.Identifier | 0 .../Info.plist:Zone.Identifier | 0 .../NotificationService.swift:Zone.Identifier | 0 ios/Podfile.lock:Zone.Identifier | 0 ios/Podfile:Zone.Identifier | 0 .../project.pbxproj:Zone.Identifier | 0 .../contents.xcworkspacedata:Zone.Identifier | 0 .../IDEWorkspaceChecks.plist:Zone.Identifier | 0 ...rkspaceSettings.xcsettings:Zone.Identifier | 0 .../xcschemes/Runner.xcscheme:Zone.Identifier | 0 .../contents.xcworkspacedata:Zone.Identifier | 0 .../IDEWorkspaceChecks.plist:Zone.Identifier | 0 ...rkspaceSettings.xcsettings:Zone.Identifier | 0 ios/Runner/AppDelegate.swift:Zone.Identifier | 0 .../100.png:Zone.Identifier | 0 .../1024.png:Zone.Identifier | 0 .../114.png:Zone.Identifier | 0 .../120.png:Zone.Identifier | 0 .../128.png:Zone.Identifier | 0 .../144.png:Zone.Identifier | 0 .../152.png:Zone.Identifier | 0 .../AppIcon.appiconset/16.png:Zone.Identifier | 0 .../167.png:Zone.Identifier | 0 .../180.png:Zone.Identifier | 0 .../AppIcon.appiconset/20.png:Zone.Identifier | 0 .../256.png:Zone.Identifier | 0 .../AppIcon.appiconset/29.png:Zone.Identifier | 0 .../AppIcon.appiconset/32.png:Zone.Identifier | 0 .../AppIcon.appiconset/40.png:Zone.Identifier | 0 .../AppIcon.appiconset/50.png:Zone.Identifier | 0 .../512.png:Zone.Identifier | 0 .../AppIcon.appiconset/57.png:Zone.Identifier | 0 .../AppIcon.appiconset/58.png:Zone.Identifier | 0 .../AppIcon.appiconset/60.png:Zone.Identifier | 0 .../AppIcon.appiconset/64.png:Zone.Identifier | 0 .../AppIcon.appiconset/72.png:Zone.Identifier | 0 .../AppIcon.appiconset/76.png:Zone.Identifier | 0 .../AppIcon.appiconset/80.png:Zone.Identifier | 0 .../AppIcon.appiconset/87.png:Zone.Identifier | 0 .../Contents.json:Zone.Identifier | 0 .../69 1.png:Zone.Identifier | 0 .../69 2.png:Zone.Identifier | 0 .../69.png:Zone.Identifier | 0 .../Contents.json:Zone.Identifier | 0 .../README.md:Zone.Identifier | 0 .../appstore.png:Zone.Identifier | 0 .../playstore.png:Zone.Identifier | 0 .../LaunchScreen.storyboard:Zone.Identifier | 0 .../Main.storyboard:Zone.Identifier | 0 .../GoogleService-Info.plist:Zone.Identifier | 0 ios/Runner/Info.plist:Zone.Identifier | 0 .../PrivacyInfo.xcprivacy:Zone.Identifier | 0 .../Runner-Bridging-Header.h:Zone.Identifier | 0 .../Runner.entitlements:Zone.Identifier | 0 .../InfoPlist.strings:Zone.Identifier | 0 .../InfoPlist.strings:Zone.Identifier | 0 lib/actions/actions.dart:Zone.Identifier | 0 lib/app_state.dart:Zone.Identifier | 0 .../api_calls.dart:Zone.Identifier | 0 .../api_manager.dart:Zone.Identifier | 0 ...get_streamed_response.dart:Zone.Identifier | 0 .../pushNotificationService.dart | 38 +++- ...shNotificationService.dart:Zone.Identifier | 0 ...apNotifcationActivity.dart:Zone.Identifier | 0 .../schema/enums/enums.dart:Zone.Identifier | 0 .../device_struct.dart:Zone.Identifier | 0 .../schema/structs/index.dart:Zone.Identifier | 0 .../util/schema_util.dart:Zone.Identifier | 0 ...nu_button_item_widget.dart:Zone.Identifier | 0 .../menu_card_item.dart:Zone.Identifier | 0 .../atom_image_svg_theme.dart:Zone.Identifier | 0 ...field_component_model.dart:Zone.Identifier | 0 ...ield_component_widget.dart:Zone.Identifier | 0 .../menu_item/menu_item.dart:Zone.Identifier | 0 .../opt_modal_model.dart:Zone.Identifier | 0 .../opt_modal_widget.dart:Zone.Identifier | 0 .../opt_modal_model.dart:Zone.Identifier | 0 .../opt_modal_widget.dart:Zone.Identifier | 0 ...selection_modal_model.dart:Zone.Identifier | 0 ...election_modal_widget.dart:Zone.Identifier | 0 ...throw_exception_model.dart:Zone.Identifier | 0 ...hrow_exception_widget.dart:Zone.Identifier | 0 ...found_component_model.dart:Zone.Identifier | 0 ...ound_component_widget.dart:Zone.Identifier | 0 ...ocals_component_model.dart:Zone.Identifier | 0 ...cals_component_widget.dart:Zone.Identifier | 0 ...ocals_component_model.dart:Zone.Identifier | 0 ...cals_component_widget.dart:Zone.Identifier | 0 ...ofile_component_model.dart:Zone.Identifier | 0 ...file_component_widget.dart:Zone.Identifier | 0 .../menu_component_model.dart:Zone.Identifier | 0 ...menu_component_widget.dart:Zone.Identifier | 0 ..._view_component_model.dart:Zone.Identifier | 0 ...view_component_widget.dart:Zone.Identifier | 0 ..._view_component_model.dart:Zone.Identifier | 0 ...view_component_widget.dart:Zone.Identifier | 0 ..._well_component_model.dart:Zone.Identifier | 0 .../message_well_component_widget.dart | 201 +++++++++++------- ...well_component_widget.dart:Zone.Identifier | 0 ...le_visit_detail_model.dart:Zone.Identifier | 0 ...e_visit_detail_widget.dart:Zone.Identifier | 0 ...ocals_component_model.dart:Zone.Identifier | 0 ...cals_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 .../change_pass_model.dart:Zone.Identifier | 0 .../change_pass_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...ge_notification_model.dart:Zone.Identifier | 0 .../message_notification_widget.dart | 13 +- ...e_notification_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...ew_visit_detail_model.dart:Zone.Identifier | 0 ...w_visit_detail_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ...plate_component_model.dart:Zone.Identifier | 0 ...late_component_widget.dart:Zone.Identifier | 0 ..._image_file_to_base64.dart:Zone.Identifier | 0 ...onvert_to_upload_file.dart:Zone.Identifier | 0 .../get_dev_u_u_i_d.dart:Zone.Identifier | 0 .../actions/index.dart:Zone.Identifier | 0 .../image_cropper.dart:Zone.Identifier | 0 .../widgets/index.dart:Zone.Identifier | 0 .../widgets/menu.dart:Zone.Identifier | 0 lib/firebase_options.dart:Zone.Identifier | 0 .../custom_functions.dart:Zone.Identifier | 0 .../custom_icons.dart:Zone.Identifier | 0 ...utter_flow_animations.dart:Zone.Identifier | 0 ...er_flow_button_tabbar.dart:Zone.Identifier | 0 ...r_flow_checkbox_group.dart:Zone.Identifier | 0 ...lutter_flow_drop_down.dart:Zone.Identifier | 0 ...tter_flow_icon_button.dart:Zone.Identifier | 0 .../flutter_flow_model.dart:Zone.Identifier | 0 .../flutter_flow_theme.dart:Zone.Identifier | 0 .../flutter_flow_util.dart:Zone.Identifier | 0 .../flutter_flow_widgets.dart:Zone.Identifier | 0 ...form_field_controller.dart:Zone.Identifier | 0 .../internationalization.dart:Zone.Identifier | 0 .../keep_alive_wrapper.dart:Zone.Identifier | 0 lib/flutter_flow/lat_lng.dart:Zone.Identifier | 0 lib/flutter_flow/nav/nav.dart:Zone.Identifier | 0 .../serialization_util.dart:Zone.Identifier | 0 .../permissions_util.dart:Zone.Identifier | 0 lib/flutter_flow/place.dart:Zone.Identifier | 0 .../random_data_util.dart:Zone.Identifier | 0 .../request_manager.dart:Zone.Identifier | 0 .../upload_data.dart:Zone.Identifier | 0 .../uploaded_file.dart:Zone.Identifier | 0 lib/index.dart:Zone.Identifier | 0 lib/main.dart:Zone.Identifier | 0 ...ss_history_page_model.dart:Zone.Identifier | 0 ...s_history_page_widget.dart:Zone.Identifier | 0 ...fast_pass_page_widget.dart:Zone.Identifier | 0 .../home_page_model.dart:Zone.Identifier | 0 .../home_page_widget.dart:Zone.Identifier | 0 ...eration_history_model.dart:Zone.Identifier | 0 ...ration_history_widget.dart:Zone.Identifier | 0 ...ge_history_page_model.dart:Zone.Identifier | 0 ...e_history_page_widget.dart:Zone.Identifier | 0 ...e_property_page_model.dart:Zone.Identifier | 0 ..._property_page_widget.dart:Zone.Identifier | 0 .../preferences_settings_model.dart | 101 ++++++--- ...rences_settings_model.dart:Zone.Identifier | 0 ...ences_settings_widget.dart:Zone.Identifier | 0 .../qr_code_page_model.dart:Zone.Identifier | 0 .../qr_code_page_widget.dart:Zone.Identifier | 0 ...er_visitor_page_model.dart:Zone.Identifier | 0 ...r_visitor_page_widget.dart:Zone.Identifier | 0 ...lete_visit_page_model.dart:Zone.Identifier | 0 ...ete_visit_page_widget.dart:Zone.Identifier | 0 ...onal_visit_page_model.dart:Zone.Identifier | 0 ...nal_visit_page_widget.dart:Zone.Identifier | 0 .../sign_in_page_model.dart:Zone.Identifier | 0 .../sign_in_page_widget.dart:Zone.Identifier | 0 .../sign_up_page_model.dart:Zone.Identifier | 0 .../sign_up_page_widget.dart:Zone.Identifier | 0 .../test_page/test_page.dart:Zone.Identifier | 0 ...it_history_page_model.dart:Zone.Identifier | 0 ...t_history_page_widget.dart:Zone.Identifier | 0 .../welcome_page_model.dart:Zone.Identifier | 0 .../welcome_page_widget.dart:Zone.Identifier | 0 .../atom_terms_of_use.dart:Zone.Identifier | 0 .../enum_throw_exception.dart:Zone.Identifier | 0 .../utils/dialog_util.dart:Zone.Identifier | 0 .../utils/log_util.dart:Zone.Identifier | 0 .../utils/validator_util.dart:Zone.Identifier | 0 pubspec.lock:Zone.Identifier | 0 pubspec.yaml:Zone.Identifier | 0 scripts/remove_zone_identifier.sh | 6 + test/widget_test.dart:Zone.Identifier | 0 web/favicon.png:Zone.Identifier | 0 web/icons/Icon-192.png:Zone.Identifier | 0 web/icons/Icon-512.png:Zone.Identifier | 0 .../app_launcher_icon.svg:Zone.Identifier | 0 web/index.html:Zone.Identifier | 0 276 files changed, 233 insertions(+), 126 deletions(-) delete mode 100644 .tool-versions:Zone.Identifier delete mode 100644 README.md:Zone.Identifier delete mode 100644 analysis_options.yaml:Zone.Identifier delete mode 100644 android/.gitignore:Zone.Identifier delete mode 100644 android/app/build.gradle:Zone.Identifier delete mode 100644 android/app/google-services.json:Zone.Identifier delete mode 100644 android/app/src/debug/AndroidManifest.xml:Zone.Identifier delete mode 100644 android/app/src/main/AndroidManifest.xml:Zone.Identifier delete mode 100644 android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier delete mode 100644 android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier delete mode 100644 android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier delete mode 100644 android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier delete mode 100644 android/app/src/main/res/values-night/styles.xml:Zone.Identifier delete mode 100644 android/app/src/main/res/values-v31/styles.xml:Zone.Identifier delete mode 100644 android/app/src/main/res/values/strings.xml:Zone.Identifier delete mode 100644 android/app/src/main/res/values/styles.xml:Zone.Identifier delete mode 100644 android/app/src/profile/AndroidManifest.xml:Zone.Identifier delete mode 100644 android/build.gradle:Zone.Identifier delete mode 100644 android/gradle.properties:Zone.Identifier delete mode 100644 android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier delete mode 100644 android/settings.gradle:Zone.Identifier delete mode 100644 assets/audios/favicon.png:Zone.Identifier delete mode 100644 assets/fonts/Nunito-Medium.ttf:Zone.Identifier delete mode 100644 assets/fonts/Nunito-Regular.ttf:Zone.Identifier delete mode 100644 assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier delete mode 100644 assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier delete mode 100644 assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier delete mode 100644 assets/fonts/favicon.png:Zone.Identifier delete mode 100644 assets/fonts/icons.ttf:Zone.Identifier delete mode 100644 assets/fonts/menu.ttf:Zone.Identifier delete mode 100644 assets/images/adaptive_background_icon.svg:Zone.Identifier delete mode 100644 assets/images/adaptive_foreground_icon.svg:Zone.Identifier delete mode 100644 assets/images/app_launcher_icon.svg:Zone.Identifier delete mode 100644 assets/images/dark/login.svg:Zone.Identifier delete mode 100644 assets/images/dark/register.svg:Zone.Identifier delete mode 100644 assets/images/dark/welcome.svg:Zone.Identifier delete mode 100644 assets/images/error_image.svg:Zone.Identifier delete mode 100644 assets/images/favicon.png:Zone.Identifier delete mode 100644 assets/images/light/login.svg:Zone.Identifier delete mode 100644 assets/images/light/register.svg:Zone.Identifier delete mode 100644 assets/images/light/welcome.svg:Zone.Identifier delete mode 100644 assets/images/logo.svg:Zone.Identifier delete mode 100644 assets/lottie_animations/favicon.png:Zone.Identifier delete mode 100644 assets/pdfs/favicon.png:Zone.Identifier delete mode 100644 assets/rive_animations/favicon.png:Zone.Identifier delete mode 100644 assets/videos/favicon.png:Zone.Identifier delete mode 100644 devtools_options.yaml:Zone.Identifier delete mode 100644 firebase.json:Zone.Identifier delete mode 100644 ios/.gitignore:Zone.Identifier delete mode 100644 ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier delete mode 100644 ios/Flutter/Debug.xcconfig:Zone.Identifier delete mode 100644 ios/Flutter/Release.xcconfig:Zone.Identifier delete mode 100644 ios/ImageNotification/Info.plist:Zone.Identifier delete mode 100644 ios/ImageNotification/NotificationService.swift:Zone.Identifier delete mode 100644 ios/Podfile.lock:Zone.Identifier delete mode 100644 ios/Podfile:Zone.Identifier delete mode 100644 ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier delete mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier delete mode 100644 ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier delete mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier delete mode 100644 ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier delete mode 100644 ios/Runner/AppDelegate.swift:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier delete mode 100644 ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier delete mode 100644 ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier delete mode 100644 ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier delete mode 100644 ios/Runner/GoogleService-Info.plist:Zone.Identifier delete mode 100644 ios/Runner/Info.plist:Zone.Identifier delete mode 100644 ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier delete mode 100644 ios/Runner/Runner-Bridging-Header.h:Zone.Identifier delete mode 100644 ios/Runner/Runner.entitlements:Zone.Identifier delete mode 100644 ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier delete mode 100644 ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier delete mode 100644 lib/actions/actions.dart:Zone.Identifier delete mode 100644 lib/app_state.dart:Zone.Identifier delete mode 100644 lib/backend/api_requests/api_calls.dart:Zone.Identifier delete mode 100644 lib/backend/api_requests/api_manager.dart:Zone.Identifier delete mode 100644 lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier delete mode 100644 lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier delete mode 100644 lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier delete mode 100644 lib/backend/schema/enums/enums.dart:Zone.Identifier delete mode 100644 lib/backend/schema/structs/device_struct.dart:Zone.Identifier delete mode 100644 lib/backend/schema/structs/index.dart:Zone.Identifier delete mode 100644 lib/backend/schema/util/schema_util.dart:Zone.Identifier delete mode 100644 lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier delete mode 100644 lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier delete mode 100644 lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier delete mode 100644 lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier delete mode 100644 lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier delete mode 100644 lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier delete mode 100644 lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier delete mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier delete mode 100644 lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier delete mode 100644 lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier delete mode 100644 lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier delete mode 100644 lib/custom_code/actions/index.dart:Zone.Identifier delete mode 100644 lib/custom_code/widgets/image_cropper.dart:Zone.Identifier delete mode 100644 lib/custom_code/widgets/index.dart:Zone.Identifier delete mode 100644 lib/custom_code/widgets/menu.dart:Zone.Identifier delete mode 100644 lib/firebase_options.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/custom_functions.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/custom_icons.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/form_field_controller.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/internationalization.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/lat_lng.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/nav/nav.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/permissions_util.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/place.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/random_data_util.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/request_manager.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/upload_data.dart:Zone.Identifier delete mode 100644 lib/flutter_flow/uploaded_file.dart:Zone.Identifier delete mode 100644 lib/index.dart:Zone.Identifier delete mode 100644 lib/main.dart:Zone.Identifier delete mode 100644 lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/home_page/home_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/home_page/home_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier delete mode 100644 lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier delete mode 100644 lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier delete mode 100644 lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier delete mode 100644 lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/test_page/test_page.dart:Zone.Identifier delete mode 100644 lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier delete mode 100644 lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier delete mode 100644 lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier delete mode 100644 lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier delete mode 100644 lib/shared/enums/enum_throw_exception.dart:Zone.Identifier delete mode 100644 lib/shared/utils/dialog_util.dart:Zone.Identifier delete mode 100644 lib/shared/utils/log_util.dart:Zone.Identifier delete mode 100644 lib/shared/utils/validator_util.dart:Zone.Identifier delete mode 100644 pubspec.lock:Zone.Identifier delete mode 100644 pubspec.yaml:Zone.Identifier create mode 100755 scripts/remove_zone_identifier.sh delete mode 100644 test/widget_test.dart:Zone.Identifier delete mode 100644 web/favicon.png:Zone.Identifier delete mode 100644 web/icons/Icon-192.png:Zone.Identifier delete mode 100644 web/icons/Icon-512.png:Zone.Identifier delete mode 100644 web/icons/app_launcher_icon.svg:Zone.Identifier delete mode 100644 web/index.html:Zone.Identifier diff --git a/.tool-versions:Zone.Identifier b/.tool-versions:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/README.md:Zone.Identifier b/README.md:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/analysis_options.yaml:Zone.Identifier b/analysis_options.yaml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/.gitignore:Zone.Identifier b/android/.gitignore:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/build.gradle:Zone.Identifier b/android/app/build.gradle:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/google-services.json:Zone.Identifier b/android/app/google-services.json:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/debug/AndroidManifest.xml:Zone.Identifier b/android/app/src/debug/AndroidManifest.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/AndroidManifest.xml:Zone.Identifier b/android/app/src/main/AndroidManifest.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier b/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier b/android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier b/android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier b/android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/values-night/styles.xml:Zone.Identifier b/android/app/src/main/res/values-night/styles.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/values-v31/styles.xml:Zone.Identifier b/android/app/src/main/res/values-v31/styles.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/values/strings.xml:Zone.Identifier b/android/app/src/main/res/values/strings.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/main/res/values/styles.xml:Zone.Identifier b/android/app/src/main/res/values/styles.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/app/src/profile/AndroidManifest.xml:Zone.Identifier b/android/app/src/profile/AndroidManifest.xml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/build.gradle:Zone.Identifier b/android/build.gradle:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/gradle.properties:Zone.Identifier b/android/gradle.properties:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier b/android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/android/settings.gradle:Zone.Identifier b/android/settings.gradle:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/audios/favicon.png:Zone.Identifier b/assets/audios/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/Nunito-Medium.ttf:Zone.Identifier b/assets/fonts/Nunito-Medium.ttf:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/Nunito-Regular.ttf:Zone.Identifier b/assets/fonts/Nunito-Regular.ttf:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier b/assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier b/assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier b/assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/favicon.png:Zone.Identifier b/assets/fonts/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/icons.ttf:Zone.Identifier b/assets/fonts/icons.ttf:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/fonts/menu.ttf:Zone.Identifier b/assets/fonts/menu.ttf:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/adaptive_background_icon.svg:Zone.Identifier b/assets/images/adaptive_background_icon.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/adaptive_foreground_icon.svg:Zone.Identifier b/assets/images/adaptive_foreground_icon.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/app_launcher_icon.svg:Zone.Identifier b/assets/images/app_launcher_icon.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/dark/login.svg:Zone.Identifier b/assets/images/dark/login.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/dark/register.svg:Zone.Identifier b/assets/images/dark/register.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/dark/welcome.svg:Zone.Identifier b/assets/images/dark/welcome.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/error_image.svg:Zone.Identifier b/assets/images/error_image.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/favicon.png:Zone.Identifier b/assets/images/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/light/login.svg:Zone.Identifier b/assets/images/light/login.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/light/register.svg:Zone.Identifier b/assets/images/light/register.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/light/welcome.svg:Zone.Identifier b/assets/images/light/welcome.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/images/logo.svg:Zone.Identifier b/assets/images/logo.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/lottie_animations/favicon.png:Zone.Identifier b/assets/lottie_animations/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/pdfs/favicon.png:Zone.Identifier b/assets/pdfs/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/rive_animations/favicon.png:Zone.Identifier b/assets/rive_animations/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/videos/favicon.png:Zone.Identifier b/assets/videos/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/devtools_options.yaml:Zone.Identifier b/devtools_options.yaml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/firebase.json:Zone.Identifier b/firebase.json:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/.gitignore:Zone.Identifier b/ios/.gitignore:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier b/ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Flutter/Debug.xcconfig:Zone.Identifier b/ios/Flutter/Debug.xcconfig:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Flutter/Release.xcconfig:Zone.Identifier b/ios/Flutter/Release.xcconfig:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/ImageNotification/Info.plist:Zone.Identifier b/ios/ImageNotification/Info.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/ImageNotification/NotificationService.swift:Zone.Identifier b/ios/ImageNotification/NotificationService.swift:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Podfile.lock:Zone.Identifier b/ios/Podfile.lock:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Podfile:Zone.Identifier b/ios/Podfile:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier b/ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier b/ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/AppDelegate.swift:Zone.Identifier b/ios/Runner/AppDelegate.swift:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/GoogleService-Info.plist:Zone.Identifier b/ios/Runner/GoogleService-Info.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Info.plist:Zone.Identifier b/ios/Runner/Info.plist:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier b/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier b/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/Runner.entitlements:Zone.Identifier b/ios/Runner/Runner.entitlements:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/actions/actions.dart:Zone.Identifier b/lib/actions/actions.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/app_state.dart:Zone.Identifier b/lib/app_state.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/api_requests/api_calls.dart:Zone.Identifier b/lib/backend/api_requests/api_calls.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/api_requests/api_manager.dart:Zone.Identifier b/lib/backend/api_requests/api_manager.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier b/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index a9224dc3..563095f5 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -393,19 +393,34 @@ class NotificationHandler { log('Notification "message": $message'); showDialog( useSafeArea: true, + barrierDismissible: true, context: context, builder: (BuildContext context) { - return Dialog( - backgroundColor: Colors.transparent, - child: MessageNotificationModalTemplateComponentWidget( - id: message['local']['CLI_ID'].toString(), - from: message['remetente'].toString(), - to: message['destinatario'].toString() == 'O' - ? 'Morador' - : 'Visitante', - message: extra['body'].toString().isEmpty - ? 'Unknown' - : extra['body'].toString(), + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: Dialog( + backgroundColor: Colors.transparent, + child: GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: MessageNotificationModalTemplateComponentWidget( + id: message['local']['CLI_ID'].toString(), + from: message['remetente'].toString(), + to: message['destinatario'].toString() == 'O' + ? 'Morador' + : 'Visitante', + message: extra['body'].toString().isEmpty + ? 'Unknown' + : extra['body'].toString(), + ), + ), + ), + ), ), ); }, @@ -418,6 +433,7 @@ class NotificationHandler { showDialog( context: context, barrierDismissible: true, + // barrierColor: Colors.green, builder: (BuildContext context) { _getIdBasedOnUserType(message); return Dialog( diff --git a/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier b/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier b/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/schema/enums/enums.dart:Zone.Identifier b/lib/backend/schema/enums/enums.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/schema/structs/device_struct.dart:Zone.Identifier b/lib/backend/schema/structs/device_struct.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/schema/structs/index.dart:Zone.Identifier b/lib/backend/schema/structs/index.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/backend/schema/util/schema_util.dart:Zone.Identifier b/lib/backend/schema/util/schema_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier b/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier b/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart index 29432952..fb4632a9 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; - +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -14,7 +14,6 @@ import 'package:rxdart/rxdart.dart'; // - final dropdown = BehaviorSubject>.seeded( LinkedHashMap.from({ 'All': 'A', @@ -82,7 +81,6 @@ class _MessageWellComponentWidgetState ); } - Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme) { final dropdownItems = LinkedHashMap.from({ 'All': 'A', @@ -148,7 +146,8 @@ class _MessageWellComponentWidgetState fillColor: theme.primary, ), onChanged: (String? newValue) { - safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()})); + safeSetState(() => dropdown.value = LinkedHashMap.from( + {newValue!: dropdownItems[newValue].toString()})); }, items: dropdownItems.entries .map((entry) => DropdownMenuItem( @@ -178,84 +177,138 @@ class _MessageWellComponentWidgetState ); } - Widget _buildMessageItem( - BuildContext context, dynamic message, int index) { + Widget _buildMessageItem(BuildContext context, dynamic message, int index) { final theme = FlutterFlowTheme.of(context); String formatMessageOrigin(String messageOrigin) { final words = messageOrigin.split(' '); final formattedWords = words.map((word) { + if (word.isEmpty) return word; // Handle empty words final firstLetter = word.substring(0, 1).toUpperCase(); - final remainingLetters = word.substring(1).toLowerCase(); + final remainingLetters = + word.length > 1 ? word.substring(1).toLowerCase() : ''; return '$firstLetter$remainingLetters'; }); return formattedWords.join(' '); } - return GestureDetector( - onTap: () => {}, - child: Padding( - padding: const EdgeInsets.fromLTRB(20, 5, 20, 5), - child: Container( - width: MediaQuery.of(context).size.width * 0.9, - height: 127.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), - child: Container( - width: 64.0, - height: 64.0, - decoration: const BoxDecoration(shape: BoxShape.circle), + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 30), + child: Card( + color: FlutterFlowTheme.of(context).primaryBackground, + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + message['MSG_DESTINO_TP'] == 'T' + ? EvaIcons.globe + : message['MSG_DESTINO_TP'] == 'P' + ? Icons.person + : Icons.home, + color: FlutterFlowTheme.of(context).primary, + size: 25, + ), + Expanded( + child: Text( + message['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ].divide(const SizedBox(width: 10)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.history, + color: + FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + message['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: + FlutterFlowTheme.of(context).customColor6, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ].divide(const SizedBox(width: 15)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.message, + color: + FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + message['MSG_TEXTO'].toString(), + ), + ), + ].divide(const SizedBox(width: 15)), + ), + ].divide(const SizedBox(height: 4)), + ), + ), + // Row( + // children: [ + // Icon( + // Icons.message, + // color: FlutterFlowTheme.of(context).customColor6, + // size: 15, + // ), + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Text( + // message['MSG_TEXTO'].toString(), + // ), + // ), + // ), + // ] + // .addToStart(const SizedBox(width: 8)) + // .addToEnd(const SizedBox(width: 8))), + ].divide( + const SizedBox(height: 8), ), ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 8.0), - Center( - child: Text( - '~ ${formatMessageOrigin(message['MSG_ORIGEM_DESC'].toString())}', - style: theme.bodyMedium.copyWith( - fontFamily: 'Nunito Sans', - color: theme.primary, - fontSize: 14.0, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 8.0), - Expanded( - child: SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Text( - formatMessageOrigin(message['MSG_TEXTO'].toString()), - style: theme.bodyMedium.copyWith( - fontFamily: 'Nunito Sans', - color: theme.bodyMedium.color, - fontSize: 14.0, - ), - softWrap: true, - maxLines: 10, - ), - ), - ), - ], - ), - ) - ], + ), ), - ), - ), - ); + )); } - - } class MessageWellState { @@ -277,9 +330,8 @@ class MessageWellState { return MessageWellState( messages: messages ?? this.messages, pageNumber: pageNumber ?? this.pageNumber, - allowScrollInSingleChildScrollView: - allowScrollInSingleChildScrollView ?? - this.allowScrollInSingleChildScrollView, + allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? + this.allowScrollInSingleChildScrollView, ); } } @@ -300,7 +352,7 @@ class MessageWellNotifier extends StateNotifier { fetchMessages(); } - void fetchMessages() async { + void fetchMessages() async { if (state.pageNumber <= totalPageNumber) { var apiCall = GetMessagesCall(); var response = await apiCall.call( @@ -333,6 +385,7 @@ class MessageWellNotifier extends StateNotifier { List getMessages() { return state.messages; } + void incrementPageNumber() { if (state.pageNumber <= totalPageNumber) { state = state.copyWith(pageNumber: state.pageNumber + 1); @@ -343,4 +396,4 @@ class MessageWellNotifier extends StateNotifier { final messageWellProvider = StateNotifierProvider((ref) { return MessageWellNotifier(); -}); \ No newline at end of file +}); diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 964a9cd7..2fcd6399 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -5,7 +5,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -54,7 +53,6 @@ class _MessageNotificationModalTemplateComponentWidgetState _model.textController3 ??= TextEditingController(text: widget.to); _model.textFieldFocusNode3 ??= FocusNode(); - } @override @@ -73,7 +71,7 @@ class _MessageNotificationModalTemplateComponentWidgetState child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), child: Container( - width: MediaQuery.sizeOf(context).width * 0.9, + width: MediaQuery.sizeOf(context).width, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -88,7 +86,6 @@ class _MessageNotificationModalTemplateComponentWidgetState mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Padding( padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), @@ -105,7 +102,6 @@ class _MessageNotificationModalTemplateComponentWidgetState ptText: 'Mensagem', enText: 'Message', ), - labelStyle: FlutterFlowTheme.of(context) .labelMedium .override( @@ -163,7 +159,8 @@ class _MessageNotificationModalTemplateComponentWidgetState obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getVariableText( + labelText: + FFLocalizations.of(context).getVariableText( ptText: 'De', enText: 'From', ), @@ -278,8 +275,6 @@ class _MessageNotificationModalTemplateComponentWidgetState _model.textController3Validator.asValidator(context), ), ), - - ] .divide(const SizedBox(height: 10.0)) .addToStart(const SizedBox(height: 20.0)) @@ -290,4 +285,4 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier b/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier b/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier b/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/actions/index.dart:Zone.Identifier b/lib/custom_code/actions/index.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier b/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/widgets/index.dart:Zone.Identifier b/lib/custom_code/widgets/index.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/custom_code/widgets/menu.dart:Zone.Identifier b/lib/custom_code/widgets/menu.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/firebase_options.dart:Zone.Identifier b/lib/firebase_options.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/custom_functions.dart:Zone.Identifier b/lib/flutter_flow/custom_functions.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/custom_icons.dart:Zone.Identifier b/lib/flutter_flow/custom_icons.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/form_field_controller.dart:Zone.Identifier b/lib/flutter_flow/form_field_controller.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/internationalization.dart:Zone.Identifier b/lib/flutter_flow/internationalization.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier b/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/lat_lng.dart:Zone.Identifier b/lib/flutter_flow/lat_lng.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/nav/nav.dart:Zone.Identifier b/lib/flutter_flow/nav/nav.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier b/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/permissions_util.dart:Zone.Identifier b/lib/flutter_flow/permissions_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/place.dart:Zone.Identifier b/lib/flutter_flow/place.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/random_data_util.dart:Zone.Identifier b/lib/flutter_flow/random_data_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/request_manager.dart:Zone.Identifier b/lib/flutter_flow/request_manager.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/upload_data.dart:Zone.Identifier b/lib/flutter_flow/upload_data.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/flutter_flow/uploaded_file.dart:Zone.Identifier b/lib/flutter_flow/uploaded_file.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/index.dart:Zone.Identifier b/lib/index.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/main.dart:Zone.Identifier b/lib/main.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier b/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/home_page/home_page_model.dart:Zone.Identifier b/lib/pages/home_page/home_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/home_page/home_page_widget.dart:Zone.Identifier b/lib/pages/home_page/home_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index a27db0b9..87b3dae7 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -8,6 +8,7 @@ import 'package:hub/components/templates_components/change_passs_qr_code_pass_ke import 'package:hub/flutter_flow/flutter_flow_icon_button.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/nav/nav.dart'; import 'package:share_plus/share_plus.dart'; @@ -164,21 +165,29 @@ class PreferencesPageModel with ChangeNotifier { ), ), actions: [ - TextButton( + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', + ), onPressed: () { Navigator.pop(context); }, - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Cancel', - ptText: 'Cancelar', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText), - ), + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), ), - TextButton( - onPressed: () { + FFButtonWidget( + onPressed: () async { PhpGroup.resopndeVinculo .call( userUUID: FFAppState().userUUID, @@ -186,7 +195,8 @@ class PreferencesPageModel with ChangeNotifier { cliID: FFAppState().cliUUID, tarefa: 'I', ) - .catchError((err) { + // ignore: body_might_complete_normally_catch_error + .catchError((err, stack) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( @@ -216,13 +226,22 @@ class PreferencesPageModel with ChangeNotifier { ); notifyListeners(); }, - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Unlink', - ptText: 'Desvincular', + text: FFLocalizations.of(context).getVariableText( + enText: 'Unlink', + ptText: 'Desvincular', + ), + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, ), - style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), ), ), ], @@ -250,18 +269,27 @@ class PreferencesPageModel with ChangeNotifier { ), ), actions: [ - TextButton( + FFButtonWidget( onPressed: () => Navigator.pop(context), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Cancel', - ptText: 'Cancelar', + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, ), - style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', ), ), - TextButton( + FFButtonWidget( onPressed: () { PhpGroup.deleteAccount .call( @@ -303,13 +331,22 @@ class PreferencesPageModel with ChangeNotifier { }); notifyListeners(); }, - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Delete', - ptText: 'Deletar', + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, ), - style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'Delete', + ptText: 'Deletar', ), ), ], diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/test_page/test_page.dart:Zone.Identifier b/lib/pages/test_page/test_page.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier b/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier b/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/shared/utils/dialog_util.dart:Zone.Identifier b/lib/shared/utils/dialog_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/shared/utils/log_util.dart:Zone.Identifier b/lib/shared/utils/log_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/shared/utils/validator_util.dart:Zone.Identifier b/lib/shared/utils/validator_util.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/pubspec.lock:Zone.Identifier b/pubspec.lock:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/pubspec.yaml:Zone.Identifier b/pubspec.yaml:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/remove_zone_identifier.sh b/scripts/remove_zone_identifier.sh new file mode 100755 index 00000000..9cee8a8a --- /dev/null +++ b/scripts/remove_zone_identifier.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Encontra e remove todos os arquivos com final :Zone.Identifier +find . -type f -name '*:Zone.Identifier' -exec rm -f {} + + +echo "Todos os arquivos :Zone.Identifier foram removidos." \ No newline at end of file diff --git a/test/widget_test.dart:Zone.Identifier b/test/widget_test.dart:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/web/favicon.png:Zone.Identifier b/web/favicon.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/web/icons/Icon-192.png:Zone.Identifier b/web/icons/Icon-192.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/web/icons/Icon-512.png:Zone.Identifier b/web/icons/Icon-512.png:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/web/icons/app_launcher_icon.svg:Zone.Identifier b/web/icons/app_launcher_icon.svg:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 diff --git a/web/index.html:Zone.Identifier b/web/index.html:Zone.Identifier deleted file mode 100644 index e69de29b..00000000 From 330d86c1028112f2f5b6f5c610b4f7381173ab68 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 09:21:18 -0300 Subject: [PATCH 26/72] fix handtap qrcode for async setState --- .../pushNotificationService.dart | 21 +- .../details_component_action.dart | 415 +++++++++++ .../details_component_model.dart} | 5 +- .../details_component_widget.dart | 357 +++++++++ ...sit_request_template_component_widget.dart | 279 ------- .../liberation_history_widget.dart | 3 +- .../message_history_page_widget.dart | 68 +- .../preferences_settings_model.dart | 2 +- .../qr_code_page/qr_code_page_widget.dart | 700 +++++++++--------- .../schedule_complete_visit_page_widget.dart | 85 +-- 10 files changed, 1191 insertions(+), 744 deletions(-) create mode 100644 lib/components/templates_components/details_component/details_component_action.dart rename lib/components/templates_components/{visit_request_template_component/visit_request_template_component_model.dart => details_component/details_component_model.dart} (93%) create mode 100644 lib/components/templates_components/details_component/details_component_widget.dart delete mode 100644 lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 563095f5..ac25aea2 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -14,8 +14,10 @@ import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.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:rxdart/rxdart.dart'; @@ -446,9 +448,20 @@ class NotificationHandler { vteUUID: message['idVisitante'].toString(), vawRef: message['referencia'].toString(), vawStatus: 'S', + buttons: [], labelsHashMap: Map.from({ - 'key': message['documento'], - 'value': 'E', + FFLocalizations.of(context).getVariableText( + enText: 'Visitor', + ptText: 'Visitante', + ): message['nomevisita'], + FFLocalizations.of(context).getVariableText( + enText: 'Reason', + ptText: 'Motivo', + ): message['motivo'], + FFLocalizations.of(context).getVariableText( + enText: 'Message', + ptText: 'Mensagem', + ): message['mensagem'], }), imageHashMap: Map.from({ 'key': message['documento'], @@ -459,7 +472,7 @@ class NotificationHandler { FFLocalizations.of(context).getVariableText( enText: 'Pending', ptText: 'Pendente', - ): FlutterFlowTheme.of(context).primary, + ): FlutterFlowTheme.of(context).warning, }, ], changeStatusAction: changeStatusAction, diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart new file mode 100644 index 00000000..cb5cd657 --- /dev/null +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -0,0 +1,415 @@ +import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:rxdart/rxdart.dart'; +import 'package:share_plus/share_plus.dart'; + +bool? getStatus(dynamic data) { + return data == 'A' + ? true + : data == 'F' || data == 'B' || data == 'C' || data == 'I' + ? false + : null; +} + +Widget buildDetails( + dynamic visitaWrapItem, + BuildContext context, + Future Function(BuildContext, String, String, String, String)? + changeStatusAction) { + return VisitRequestTemplateComponentWidget( + vteName: 'Lorem Ipsus', + vteReason: 'Lorem Ipsus', + vawDate: 'Lorem Ipsus', + vawStatus: 'Lorem Ipsus', + vteMsg: 'Lorem Ipsus', + vteUUID: 'Lorem Ipsus', + cliUUID: FFAppState().cliUUID, + msgUUID: 'Lorem Ipsus', + vawDestino: 'Lorem Ipsus', + vawUUID: 'Lorem Ipsus', + vawName: 'Lorem Ipsus', + vawRef: 'Lorem Ipsus', + + changeStatusAction: changeStatusAction, + buttons: [ + if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // ACCEPT ACTION + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Aprovar Visita', + enText: 'Approve Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: 'Are you sure you want to approve this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: + FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await changeStatusAction?.call( + context, + 'L', + visitaWrapItem['VAW_REF'] ?? '', + 'Mensagem', + visitaWrapItem['VTE_ID'] ?? '', + ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // REJECT ACTION + FlutterFlowIconButton( + icon: const Icon(Icons.close), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: 'Are you sure you want to block this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: + FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + // await changeStatusAction?.call( + // context, + // 'B', + // visitaWrapItem['VAW_REF'] ?? '', + // 'Mensagem', + // visitaWrapItem['VTE_ID'] ?? '', + // ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + if (getStatus(visitaWrapItem['VAW_STATUS']) == false) // RECALL ACTION + FlutterFlowIconButton( + icon: const Icon(Icons.refresh), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: 'Are you sure you want to block this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: + FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + // await changeStatusAction?.call( + // context, + // 'B', + // visitaWrapItem['VAW_REF'] ?? '', + // 'Mensagem', + // visitaWrapItem['VTE_ID'] ?? '', + // ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + if (getStatus(visitaWrapItem['VAW_STATUS']) == false) // SHARE ACTION + FlutterFlowIconButton( + icon: const Icon(Icons.share), + onPressed: () async { + Share.share(r''' + Olá ${visitaWrapItem['VTE_NOME']} + Você foi convidado para ${visitaWrapItem['NAC_DESCRICAO']} + + Validade do Convite: + visitaWrapItem['VAW_DTINICIO'] + visitaWrapItem['VAW_DTFIM'] + + URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']} + '''); + }, + ), + + // if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // SEND ACTION + // FlutterFlowIconButton( + // icon: const Icon(Icons.send), + // onPressed: () async { + // showDialog( + // context: context, + // builder: (context) { + // return AlertDialog( + // title: Text( + // FFLocalizations.of(context).getVariableText( + // ptText: 'Bloquear Visita', + // enText: 'Block Visit', + // ), + // ), + // content: Text( + // FFLocalizations.of(context).getVariableText( + // ptText: + // 'Você tem certeza que deseja bloquear essa visita?', + // enText: 'Are you sure you want to block this visit?', + // ), + // ), + // backgroundColor: + // FlutterFlowTheme.of(context).primaryBackground, + // actions: [ + // FFButtonWidget( + // text: FFLocalizations.of(context).getVariableText( + // enText: 'No', + // ptText: 'Não', + // ), + // onPressed: () { + // Navigator.pop(context); + // }, + // options: FFButtonOptions( + // width: 100, + // height: 40, + // color: + // FlutterFlowTheme.of(context).primaryBackground, + // textStyle: TextStyle( + // color: FlutterFlowTheme.of(context).primaryText, + // ), + // borderSide: BorderSide( + // color: FlutterFlowTheme.of(context) + // .primaryBackground, + // width: 1, + // ), + // borderRadius: BorderRadius.circular(10)), + // ), + // FFButtonWidget( + // text: FFLocalizations.of(context).getVariableText( + // enText: 'Yes', + // ptText: 'Sim', + // ), + // onPressed: () async { + // // await changeStatusAction?.call( + // // context, + // // 'B', + // // visitaWrapItem['VAW_REF'] ?? '', + // // 'Mensagem', + // // visitaWrapItem['VTE_ID'] ?? '', + // // ); + // }, + // options: FFButtonOptions( + // width: 100, + // height: 40, + // color: FlutterFlowTheme.of(context).primaryBackground, + // textStyle: TextStyle( + // color: FlutterFlowTheme.of(context).primaryText, + // ), + // borderSide: BorderSide( + // color: + // FlutterFlowTheme.of(context).primaryBackground, + // width: 1, + // ), + // borderRadius: BorderRadius.circular(10), + // ), + // ), + // ], + // ); + // }); + // }, + // ), + ], + labelsHashMap: Map.from({ + 'Nome': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim': visitaWrapItem['VAW_DTFIM'] ?? '', + }), + imageHashMap: Map.from({ + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }), + statusHashMap: [ + getStatus(visitaWrapItem['VAW_STATUS']) == true + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).success, + }) + : getStatus(visitaWrapItem['VAW_STATUS']) == null + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context).warning, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }), + ], + // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], + ); +} diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/components/templates_components/details_component/details_component_model.dart similarity index 93% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart rename to lib/components/templates_components/details_component/details_component_model.dart index a5a7eb07..765e2f2c 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart +++ b/lib/components/templates_components/details_component/details_component_model.dart @@ -1,6 +1,5 @@ - import 'package:flutter/material.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitRequestTemplateComponentModel @@ -55,4 +54,4 @@ class VisitRequestTemplateComponentModel textFieldFocusNodeStatus?.dispose(); textControllerStatus?.dispose(); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart new file mode 100644 index 00000000..f6576993 --- /dev/null +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -0,0 +1,357 @@ +import 'dart:collection'; +import 'dart:developer'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/details_component/details_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:provider/provider.dart'; + +class VisitRequestTemplateComponentWidget extends StatefulWidget { + const VisitRequestTemplateComponentWidget({ + Key? key, + required this.vteName, + required this.vteReason, + required this.vteMsg, + this.vteDocument, + this.cliUUID, + this.vteUUID, + this.vawName, + this.msgUUID, + this.vawRef, + this.vawUUID, + this.vawDestino, + required this.vawStatus, + this.vawDate, + this.changeStatusAction, + required this.labelsHashMap, + required this.statusHashMap, + required this.imageHashMap, + this.onTapCardItemAction, + required this.buttons, + }); + + final Map labelsHashMap; + final List?> statusHashMap; + final Map imageHashMap; + final Future Function()? onTapCardItemAction; + final List buttons; + + final String? vteName; + final String? vteReason; + final String? vteMsg; + final String? vteDocument; + final String? cliUUID; + final String? vteUUID; + final String? vawName; + final String? msgUUID; + final String? vawRef; + final String? vawUUID; + final String? vawDestino; + final String? vawStatus; + final String? vawDate; + + final Future Function( + BuildContext context, + String status, + String vawREF, + String msg, + String vteUUID, + )? changeStatusAction; + + @override + State createState() => + _VisitRequestTemplateComponentWidgetState(); +} + +class _VisitRequestTemplateComponentWidgetState + extends State { + late VisitRequestTemplateComponentModel _model; + + LinkedHashMap get labelsLinkedHashMap => + LinkedHashMap.from(widget.labelsHashMap ?? {}); + + List> get statusLinkedHashMap => + widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => VisitRequestTemplateComponentModel()); + + _model.textController1 ??= TextEditingController(text: widget.vteName); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= TextEditingController(text: widget.vteReason); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.textController3 ??= TextEditingController(text: widget.vteMsg); + _model.textFieldFocusNode3 ??= FocusNode(); + + _model.textController4 ??= TextEditingController(text: widget.vawDate); + _model.textFieldFocusNode4 ??= FocusNode(); + + _model.textController5 ??= TextEditingController(); + _model.textFieldFocusNode5 ??= FocusNode(); + + _model.textControllerStatus ??= + TextEditingController(text: widget.vawStatus); + _model.textFieldFocusNodeStatus ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + log('VAW_STATUS: ${statusLinkedHashMap}'); + context.watch(); + bool isLoaded = false; + final pending = FFLocalizations.of(context).getVariableText( + enText: 'Pending', + ptText: 'Pendente', + ); + final active = FFLocalizations.of(context).getVariableText( + enText: 'Ativo', + ptText: 'Ativo', + ); + final canceled = FFLocalizations.of(context).getVariableText( + enText: 'Canceled', + ptText: 'Cancelado', + ); + + return LayoutBuilder( + builder: (context, constraints) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Container( + width: constraints.maxWidth, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 150.0, + height: 150.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + fit: BoxFit.cover, + ), + ), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 24.0), + child: TextFormField( + // controller: _model.textControllerStatus, + // focusNode: _model.textFieldFocusNodeStatus, + autofocus: false, + canRequestFocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: item.value, + ), + ), + filled: true, + fillColor: item.value, + labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), + ), + ), + ); + }).toList(); + }).toList(), + ), + ListView.builder( + shrinkWrap: true, + itemCount: labelsLinkedHashMap.length, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String key = labelsLinkedHashMap.keys.elementAt(index); + String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10.0, vertical: 3.0), + child: TextFormField( + readOnly: true, + initialValue: '$value', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily, + ), + ), + decoration: InputDecoration( + labelText: key, + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + ), + ), + ); + }, + ), + if (widget.buttons.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons, + ), + ), + ] + .divide(const SizedBox(height: 20.0)) + .addToEnd(const SizedBox(height: 20.0)) + .addToStart(const SizedBox(height: 20.0)), + ), + ), + ); + }, + ); + } +} diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart deleted file mode 100644 index a95cf428..00000000 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ /dev/null @@ -1,279 +0,0 @@ -import 'dart:collection'; -import 'dart:developer'; - -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart'; -import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; -import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; -import 'package:provider/provider.dart'; - -class VisitRequestTemplateComponentWidget extends StatefulWidget { - const VisitRequestTemplateComponentWidget({ - Key? key, - required this.vteName, - required this.vteReason, - required this.vteMsg, - this.vteDocument, - this.cliUUID, - this.vteUUID, - this.vawName, - this.msgUUID, - this.vawRef, - this.vawUUID, - this.vawDestino, - required this.vawStatus, - this.vawDate, - this.changeStatusAction, - required this.labelsHashMap, - required this.statusHashMap, - required this.imageHashMap, - this.onTapCardItemAction, - }); - - final Map labelsHashMap; - final List?> statusHashMap; - final Map imageHashMap; - final Future Function()? onTapCardItemAction; - - final String? vteName; - final String? vteReason; - final String? vteMsg; - final String? vteDocument; - final String? cliUUID; - final String? vteUUID; - final String? vawName; - final String? msgUUID; - final String? vawRef; - final String? vawUUID; - final String? vawDestino; - final String? vawStatus; - final String? vawDate; - - final Future Function( - BuildContext context, - String status, - String vawREF, - String msg, - String vteUUID, - )? changeStatusAction; - - @override - State createState() => - _VisitRequestTemplateComponentWidgetState(); -} - -class _VisitRequestTemplateComponentWidgetState - extends State { - late VisitRequestTemplateComponentModel _model; - - LinkedHashMap get labelsLinkedHashMap => - LinkedHashMap.from(widget.labelsHashMap ?? {}); - - List> get statusLinkedHashMap => - widget.statusHashMap - .map((map) => LinkedHashMap.from(map ?? {})) - .toList(); - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => VisitRequestTemplateComponentModel()); - - _model.textController1 ??= TextEditingController(text: widget.vteName); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(text: widget.vteReason); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(text: widget.vteMsg); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(text: widget.vawDate); - _model.textFieldFocusNode4 ??= FocusNode(); - - _model.textController5 ??= TextEditingController(); - _model.textFieldFocusNode5 ??= FocusNode(); - - _model.textControllerStatus ??= - TextEditingController(text: widget.vawStatus); - _model.textFieldFocusNodeStatus ??= FocusNode(); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - bool isLoaded = false; - log('------------------ VisitRequestTemplateComponentWidget ------------------'); - log('vteName: ${widget.imageHashMap}'); - log('Teste: ${statusLinkedHashMap.expand((linkedHashMap) { - return [ - linkedHashMap.entries - .map((MapEntry item) => item.key) - .first - ]; - }).first}'); - log('-------------------------------------------------------------------------'); - final pending = FFLocalizations.of(context).getVariableText( - enText: 'Pending', - ptText: 'Pendente', - ); - final active = FFLocalizations.of(context).getVariableText( - enText: 'Ativo', - ptText: 'Ativo', - ); - final canceled = FFLocalizations.of(context).getVariableText( - enText: 'Canceled', - ptText: 'Cancelado', - ); - - return LayoutBuilder( - builder: (context, constraints) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Container( - width: constraints.maxWidth, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - const SizedBox(height: 20.0), - Container( - width: 150.0, - height: 150.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', - fit: BoxFit.cover, - ), - ), - const SizedBox(height: 10.0), - Row( - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries - .map((MapEntry item) { - return Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 24.0), - child: TextFormField( - // controller: _model.textControllerStatus, - // focusNode: _model.textFieldFocusNodeStatus, - autofocus: false, - canRequestFocus: false, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - ), - filled: true, - fillColor: item.value, - labelText: item.key, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - ); - }).toList(); - }).toList(), - ), - const SizedBox(height: 10.0), - // ListView.builder( - // shrinkWrap: true, - // itemCount: labelsLinkedHashMap.length, - // physics: const NeverScrollableScrollPhysics(), - // itemBuilder: (context, index) { - // String key = labelsLinkedHashMap.keys.elementAt(index); - // String value = labelsLinkedHashMap[key]!; - // return Text('key: $key, value: $value'); - // }, - // ), - const SizedBox(height: 20.0), - ], - ), - ), - ), - ); - }, - ); - } -} diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 0bf40324..005a3b6b 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -7,7 +7,7 @@ import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/push_notification/pushNotificationService.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; @@ -358,6 +358,7 @@ Widget liberationHistoryItemCard( 'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'], // 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'], }), + buttons: [], statusHashMap: [ liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 7f242130..df268d4d 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -5,7 +5,6 @@ import 'dart:developer'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; @@ -16,6 +15,7 @@ import 'package:hub/pages/message_history_page/message_history_page_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/shared/utils/log_util.dart'; import 'package:provider/provider.dart'; class MessageHistoryPageWidget extends StatefulWidget { @@ -31,6 +31,8 @@ class _MessageHistoryPageWidgetState extends State late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); + int currentPage = 0; + int totalPage = 0; @override void initState() { @@ -65,13 +67,13 @@ class _MessageHistoryPageWidgetState extends State return Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarMessage(context), - body: bodyMessage(context, _model), + appBar: buildAppBar(context), + body: buildBody(context, _model), ); } } -PreferredSizeWidget appBarMessage(BuildContext context) { +PreferredSizeWidget buildAppBar(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, @@ -107,7 +109,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) { ); } -Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { +Widget buildBody(BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, child: Column( @@ -157,16 +159,16 @@ Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { ), Expanded( child: TabBarView(controller: _model.tabBarController, children: [ - liberationDynamicListView(context, _model, 'P'), - liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'T'), + buildListView(context, _model, 'P'), + buildListView(context, _model, 'A'), + buildListView(context, _model, 'T'), ])), ].addToStart(const SizedBox(height: 0)), ), ); } -Widget liberationDynamicListView( +Widget buildListView( BuildContext context, MessageHistoryPageModel _model, String DestIndex) { return Container( width: double.infinity, @@ -174,19 +176,29 @@ Widget liberationDynamicListView( decoration: const BoxDecoration(), child: FutureBuilder( future: Future(() async { + var body = { + 'devUUID': FFAppState().devUUID.toString(), + 'userUUID': FFAppState().userUUID.toString(), + 'cliID': FFAppState().cliUUID.toString(), + 'atividade': 'getMensagens', + 'pageSize': '100', + 'pageNumber': '1', + 'tipoDestino': DestIndex.toString(), + }; try { var response = await PhpGroup.getMessagesCall.call( - devUUID: FFAppState().devUUID.toString(), - userUUID: FFAppState().userUUID.toString(), - cliID: FFAppState().cliUUID.toString(), - atividade: 'getMensagens', - pageSize: '100', - pageNumber: '1', + devUUID: body['devUUID'], + userUUID: body['userUUID'], + cliID: body['cliID'], + atividade: body['atividade'], + pageSize: body['pageSize'], + pageNumber: body['pageNumber'], tipoDestino: DestIndex, ); return response.jsonBody; - } catch (error) { - log('Error: ${error.toString()}'); + } catch (error, stack) { + LogUtil.requestAPIFailed('processRequest.php', jsonEncode(body), + 'Mensagens não Encontradas', error, stack); return {'mensagens': [], 'total_rows': 0}; } }), @@ -226,7 +238,7 @@ Widget liberationDynamicListView( addRepaintBoundaries: true, cacheExtent: 1000.0, itemBuilder: (BuildContext context, int index) { - return messageHistoryItem( + return buildListItem( context, snapshot.data!['mensagens'][index], ); @@ -237,7 +249,7 @@ Widget liberationDynamicListView( ); } -Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { +Widget buildListItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -329,24 +341,6 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { ].divide(const SizedBox(height: 4)), ), ), - // Row( - // children: [ - // Icon( - // Icons.message, - // color: FlutterFlowTheme.of(context).customColor6, - // size: 15, - // ), - // Expanded( - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Text( - // jsonBody['MSG_TEXTO'].toString(), - // ), - // ), - // ), - // ] - // .addToStart(const SizedBox(width: 8)) - // .addToEnd(const SizedBox(width: 8))), ].divide( const SizedBox(height: 8), ), diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 87b3dae7..a7936422 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -91,7 +91,7 @@ class PreferencesPageModel with ChangeNotifier { Share.share( FFLocalizations.of(context).getVariableText( ptText: - 'Este é o meu identificador de acesse: ${FFAppState().userDevUUID}', + 'Este é o meu identificador de acesso: ${FFAppState().userDevUUID}', enText: 'This is my access identifier: ${FFAppState().userDevUUID}', ), ); diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index a6994b95..7ddd315d 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -16,7 +16,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; - import 'dart:async'; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; @@ -27,81 +26,76 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:qr_flutter/qr_flutter.dart'; - - - class QrCodePageWidget extends StatefulWidget { const QrCodePageWidget({super.key}); - @override State createState() => _QrCodePageWidgetState(); } - - class _QrCodePageWidgetState extends State with TickerProviderStateMixin { late QrCodePageModel _model; - final scaffoldKey = GlobalKey(); final animationsMap = {}; -@override -void initState() { - super.initState(); - _model = createModel(context, () => QrCodePageModel()); + @override + void initState() { + super.initState(); + _model = createModel(context, () => QrCodePageModel()); - // On page load action. - SchedulerBinding.instance.addPostFrameCallback((_) async { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.fling(); - } - }); + // On page load action. + SchedulerBinding.instance.addPostFrameCallback((_) async { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.fling(); + } + }); - animationsMap.addAll({ - 'barcodeOnActionTriggerAnimation': AnimationInfo( - trigger: AnimationTrigger.onActionTrigger, - applyInitialState: true, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - BlurEffect( - curve: Curves.linear, - delay: 0.0.ms, - duration: 600.0.ms, - begin: const Offset(0.0, 0.0), - end: const Offset(10.0, 10.0), - ), - ], - ), - }); - setupAnimations( - animationsMap.values.where((anim) => - anim.trigger == AnimationTrigger.onActionTrigger || - !anim.applyInitialState), - this, - ); + animationsMap.addAll({ + 'barcodeOnActionTriggerAnimation': AnimationInfo( + trigger: AnimationTrigger.onActionTrigger, + applyInitialState: true, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + BlurEffect( + curve: Curves.linear, + delay: 0.0.ms, + duration: 600.0.ms, + begin: const Offset(0.0, 0.0), + end: const Offset(10.0, 10.0), + ), + ], + ), + }); + setupAnimations( + animationsMap.values.where((anim) => + anim.trigger == AnimationTrigger.onActionTrigger || + !anim.applyInitialState), + this, + ); - // // Adicionando um ouvinte de status à animação para reiniciá-la após a conclusão - // animationsMap['barcodeOnActionTriggerAnimation']?.controller.addStatusListener((status) { - // if (status == AnimationStatus.completed) { - // animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); - // animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); - // } - // }); -} - -@override -void dispose() { - // Removendo o ouvinte antes de chamar super.dispose para evitar vazamentos de memória - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.removeStatusListener((status) {}); + // // Adicionando um ouvinte de status à animação para reiniciá-la após a conclusão + // animationsMap['barcodeOnActionTriggerAnimation']?.controller.addStatusListener((status) { + // if (status == AnimationStatus.completed) { + // animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); + // animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); + // } + // }); + } + + @override + void dispose() { + // Removendo o ouvinte antes de chamar super.dispose para evitar vazamentos de memória + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .removeStatusListener((status) {}); + } + + super.dispose(); } - - super.dispose(); -} @override Widget build(BuildContext context) { @@ -114,46 +108,46 @@ void dispose() { } Widget buildBody(BuildContext context) { - double screenWidth = MediaQuery.of(context).size.width; - double screenHeight = MediaQuery.of(context).size.height; - double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; - double dimension = smallerDimension * 0.75; - double totalTimeInSeconds = 100.0; + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + double smallerDimension = + screenWidth < screenHeight ? screenWidth : screenHeight; + double dimension = smallerDimension * 0.75; + double totalTimeInSeconds = 100.0; return SafeArea( - // top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - if (_model.isAccess == true && _model.key != null) + // top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if (_model.isAccess == true && _model.key != null) Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Use esse QR Code para acesso', - enText: 'Use this QR Code for access', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), + FFLocalizations.of(context).getVariableText( + ptText: 'Use esse QR Code para acesso', + enText: 'Use this QR Code for access', ), - Stack( - children: [ - if (_model.isAccess == true && _model.key != null) + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + Stack( + children: [ + if (_model.isAccess == true && _model.key != null) Align( alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( - onTap: () { - - safeSetState(() async { - _resetAnimationAndToggleAccess(); - FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); - }); - + onTap: () async { + safeSetState(() async { + _resetAnimationAndToggleAccess(); + }); + FFAppState().fingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); }, child: buildQrCode( dimension: dimension, @@ -164,260 +158,268 @@ void dispose() { ), ), ), - if(_model.isAccess == false && _model.key == null) + if (_model.isAccess == false && _model.key == null) Align( alignment: const AlignmentDirectional(0, 0), child: BarcodeWidget( - data: 'Barcode', - barcode: Barcode.qrCode(), + data: 'Barcode', + barcode: Barcode.qrCode(), + width: 300.0, + height: 200.0, + color: FlutterFlowTheme.of(context).primaryText, + backgroundColor: Colors.transparent, + errorBuilder: (context, error) => const SizedBox( width: 300.0, height: 200.0, - color: FlutterFlowTheme.of(context).primaryText, - backgroundColor: Colors.transparent, - errorBuilder: (context, error) => const SizedBox( - width: 300.0, - height: 200.0, - ), - drawText: false, - ).animateOnActionTrigger( - animationsMap['barcodeOnActionTriggerAnimation']!, ), + drawText: false, + ).animateOnActionTrigger( + animationsMap['barcodeOnActionTriggerAnimation']!, + ), ), - if (_model.isAccess == false && _model.key == null) + if (_model.isAccess == false && _model.key == null) Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onLongPress: () async { - await _model.qrCodeEncoder( - context, - key: _model.key, - ); - setState(() {}); - }, - child: Container( - width: 200.0, - height: 200.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); - }, - text: FFLocalizations.of(context).getVariableText( - ptText: 'Gerar QR Code', - enText: 'Generate QR Code', - ), - options: FFButtonOptions( - height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.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: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onLongPress: () async { + await _model.qrCodeEncoder( + context, + key: _model.key, + ); + setState(() {}); + }, + child: Container( + width: 200.0, + height: 200.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + FFAppState().fingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Gerar QR Code', + enText: 'Generate QR Code', ), - ), - ), - ), - ), - ], - ), - if (_model.isAccess == true && _model.key != null) - Container( - width: 300.0, - decoration: const BoxDecoration(), - child: Visibility( - visible: _model.isAccess == true, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Certifique-se de que o QRCode está visivel para o leitor', - enText: 'Make sure the QRCode is visible to the reader', - // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - if (_model.isAccess == true && _model.key != null) - Container( - width: 250.0, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100.0), - border: Border.all( - color: FlutterFlowTheme.of(context).primary, - ), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Expirando QR code em', - enText: 'Expiring QR code in', - // 'wkjkxd2e' /* Trocando QR code em */, - ), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 20.0, 0.0), - child: StreamBuilder( - stream: getProgressValue(), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return CircularProgressIndicator(); - } else if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); - } else if (!snapshot.hasData) { - return Text('No data'); - } else { - final progress = snapshot.data!; - return CircularPercentIndicator( - percent: progress, - restartAnimation: true, - reverse: false, - radius: 30.0, - lineWidth: 7.0, - animation: true, - animateFromLastPercent: true, - onAnimationEnd: () { - _resetAnimationAndToggleAccess(); - }, - progressColor: FlutterFlowTheme.of(context).primary, - backgroundColor: FlutterFlowTheme.of(context).primaryText, - center: Text( - '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', - style: FlutterFlowTheme.of(context).headlineSmall.override( - fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineSmallFamily), - ), - ), - startAngle: 20.0, - ); - } - }, + options: FFButtonOptions( + height: 40.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .titleSmallFamily), ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), ), ), - ], + ), + ), + ], + ), + if (_model.isAccess == true && _model.key != null) + Container( + width: 300.0, + decoration: const BoxDecoration(), + child: Visibility( + visible: _model.isAccess == true, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Certifique-se de que o QRCode está visivel para o leitor', + enText: 'Make sure the QRCode is visible to the reader', + // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), ), ), - ], - ), - ); + ), + if (_model.isAccess == true && _model.key != null) + Container( + width: 250.0, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100.0), + border: Border.all( + color: FlutterFlowTheme.of(context).primary, + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Expirando QR code em', + enText: 'Expiring QR code in', + // 'wkjkxd2e' /* Trocando QR code em */, + ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 20.0, 0.0), + child: StreamBuilder( + stream: getProgressValue(), + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return CircularProgressIndicator(); + } else if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else if (!snapshot.hasData) { + return Text('No data'); + } else { + final progress = snapshot.data!; + return CircularPercentIndicator( + percent: progress, + restartAnimation: true, + reverse: false, + radius: 30.0, + lineWidth: 7.0, + animation: true, + animateFromLastPercent: true, + onAnimationEnd: () { + _resetAnimationAndToggleAccess(); + }, + progressColor: + FlutterFlowTheme.of(context).primary, + backgroundColor: + FlutterFlowTheme.of(context).primaryText, + center: Text( + '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', + style: FlutterFlowTheme.of(context) + .headlineSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .headlineSmallFamily, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineSmallFamily), + ), + ), + startAngle: 20.0, + ); + } + }, + ), + ), + ), + ], + ), + ), + ], + ), + ); } - - Future _showBiometricsAuth(BuildContext context) async { - FFAppState().checkBiometrics() - .then((value) => FFAppState().authenticateBiometric() - .then( (value) { - safeSetState(() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); - } - _model.isAccess = !_model.isAccess; - _model.key = FFAppState().fingerprintPass; - }); - } )) - .onError((error, StackTrace) { - _showQrCodeBottomSheet(context); - }); - + FFAppState() + .checkBiometrics() + .then((value) => FFAppState().authenticateBiometric().then((value) { + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .stop(); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .reverse(); + } + _model.isAccess = !_model.isAccess; + _model.key = FFAppState().fingerprintPass; + }); + })) + .onError((error, StackTrace) { + _showQrCodeBottomSheet(context); + }); } Future _showQrCodeBottomSheet(BuildContext context) async { - await showModalBottomSheet( + await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, useSafeArea: true, context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - QrCodePassKeyTemplateComponentWidget( + padding: MediaQuery.viewInsetsOf(context), + child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { log('Key: $key'); safeSetState(() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + if (animationsMap['barcodeOnActionTriggerAnimation'] != + null) { + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .stop(); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .reverse(); } - _model.isAccess = !_model.isAccess; - _model.key = key; - }); + _model.isAccess = !_model.isAccess; + _model.key = key; + }); }, ), ), ); }, - ) - - .catchError((error) => safeSetState((){ - log('Error: $error'); - _resetAnimationAndToggleAccess(); + ).catchError((error) => safeSetState(() { + log('Error: $error'); + _resetAnimationAndToggleAccess(); })); unawaited( () async { @@ -431,50 +433,50 @@ void dispose() { } void _resetAnimationAndToggleAccess() { - safeSetState(() { - // Reinicia a animação - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); - // Alterna o estado de acesso - _model.isAccess = !_model.isAccess; - _model.key = null; - }); -} + safeSetState(() { + // Reinicia a animação + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); + // Alterna o estado de acesso + _model.isAccess = !_model.isAccess; + _model.key = null; + }); + } AppBar buildAppBar(BuildContext context) { return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'ku7jqe53' /* QR Code de Acesso */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + 'ku7jqe53' /* QR Code de Acesso */, ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ); + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ); } -} \ No newline at end of file +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index dd0ed8b4..7253a8c6 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1,5 +1,3 @@ -import 'dart:developer'; - import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -9,9 +7,8 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/actions/actions.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_action.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; -import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; @@ -163,6 +160,14 @@ class _ScheduleCompleteVisitPageWidgetState } } +bool? getStatus(dynamic data) { + return data == 'A' + ? true + : data == 'F' || data == 'B' || data == 'C' || data == 'I' + ? null + : false; +} + PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -1734,17 +1739,14 @@ Widget visitHistory( 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', }), statusHashMap: [ - visitaWrapItem['VAW_STATUS'] == 'A' + getStatus(visitaWrapItem['VAW_STATUS']) == true ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Ativo', enText: 'Active', ): FlutterFlowTheme.of(context).success, }) - : visitaWrapItem['VAW_STATUS'] == 'F' || - visitaWrapItem['VAW_STATUS'] == 'B' || - visitaWrapItem['VAW_STATUS'] == 'C' || - visitaWrapItem['VAW_STATUS'] == 'I' + : getStatus(visitaWrapItem['VAW_STATUS']) == null ? Map.from({ FFLocalizations.of(context) .getVariableText( @@ -1768,71 +1770,15 @@ Widget visitHistory( useSafeArea: true, context: context, builder: (context) { - return VisitRequestTemplateComponentWidget( - vteName: 'Lorem Ipsus', - vteReason: 'Lorem Ipsus', - vawDate: 'Lorem Ipsus', - vawStatus: 'Lorem Ipsus', - vteMsg: 'Lorem Ipsus', - vteUUID: 'Lorem Ipsus', - cliUUID: FFAppState().cliUUID, - msgUUID: 'Lorem Ipsus', - vawDestino: 'Lorem Ipsus', - vawUUID: 'Lorem Ipsus', - vawName: 'Lorem Ipsus', - vawRef: 'Lorem Ipsus', - labelsHashMap: Map.from({ - 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', - 'Inicio:': - visitaWrapItem['VAW_DTINICIO'] ?? '', - 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', - }), - imageHashMap: Map.from({ - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }), - statusHashMap: [ - visitaWrapItem['VAW_STATUS'] == 'A' - ? Map.from({ - FFLocalizations.of(context) - .getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context) - .success, - }) - : visitaWrapItem['VAW_STATUS'] == 'F' || - visitaWrapItem['VAW_STATUS'] == - 'B' || - visitaWrapItem['VAW_STATUS'] == - 'C' || - visitaWrapItem['VAW_STATUS'] == - 'I' - ? Map.from({ - FFLocalizations.of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context) - .warning, - }) - : Map.from({ - FFLocalizations.of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context) - .error, - }), - ], - changeStatusAction: changeStatusAction, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], + return buildDetails( + visitaWrapItem, + context, + changeStatusAction, ); }, ).then((_) { // PushNotificationManager _pushNotificationService = // PushNotificationManager(); - // _pushNotificationService.onMessageReceived // .listen((received) { // if (received.data['click_action'] == @@ -1853,7 +1799,6 @@ Widget visitHistory( // } // }); }); - // await showModalBottomSheet( // isScrollControlled: true, // backgroundColor: Colors.transparent, From 4989ba6b2b7f25cf9b1cf8928b8c111d6dda5831 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 13:35:42 -0300 Subject: [PATCH 27/72] WIP --- lib/actions/actions.dart | 1 + .../details_component_action.dart | 293 ++++++----------- ...iter_vistor_template_component_widget.dart | 299 +++++++++--------- ...tails_modal_template_component_widget.dart | 17 - .../preferences_settings_model.dart | 151 ++++++--- .../schedule_complete_visit_page_widget.dart | 94 ++++-- 6 files changed, 428 insertions(+), 427 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index d7a4ae22..a9f15c57 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -343,6 +343,7 @@ Future visitRequestComponentAction( ); if (respondeSolicitacaoCall.statusCode == 200) { + log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID'); return true; } else { log('headers: ${respondeSolicitacaoCall.headers}'); diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index cb5cd657..53ce841e 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:hub/app_state.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; @@ -5,15 +7,28 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.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:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; -bool? getStatus(dynamic data) { - return data == 'A' - ? true - : data == 'F' || data == 'B' || data == 'C' || data == 'I' - ? false - : null; +enum status { active, unknown, canceled, finished, blocked, inactive } + +status? getStatus(dynamic data) { + debugPrint('getStatus: $data'); + switch (data) { + case 'A': + return status.active; + case 'F': + return status.finished; + case 'B': + return status.blocked; + case 'C': + return status.canceled; + case 'I': + return status.inactive; + default: + return status.unknown; + } } Widget buildDetails( @@ -34,10 +49,10 @@ Widget buildDetails( vawUUID: 'Lorem Ipsus', vawName: 'Lorem Ipsus', vawRef: 'Lorem Ipsus', - changeStatusAction: changeStatusAction, buttons: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // ACCEPT ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) // ACCEPT ACTION FlutterFlowIconButton( icon: const Icon(Icons.done), onPressed: () async { @@ -93,9 +108,9 @@ Widget buildDetails( await changeStatusAction?.call( context, 'L', - visitaWrapItem['VAW_REF'] ?? '', + visitaWrapItem['VAW_ID'] ?? '', 'Mensagem', - visitaWrapItem['VTE_ID'] ?? '', + visitaWrapItem['VTE_DOCUMENTO'] ?? '', ); }, options: FFButtonOptions( @@ -118,7 +133,8 @@ Widget buildDetails( }); }, ), - if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // REJECT ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) // REJECT ACTION FlutterFlowIconButton( icon: const Icon(Icons.close), onPressed: () async { @@ -199,185 +215,45 @@ Widget buildDetails( }); }, ), - if (getStatus(visitaWrapItem['VAW_STATUS']) == false) // RECALL ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) // RECALL ACTION FlutterFlowIconButton( icon: const Icon(Icons.refresh), onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja bloquear essa visita?', - enText: 'Are you sure you want to block this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: - FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - // await changeStatusAction?.call( - // context, - // 'B', - // visitaWrapItem['VAW_REF'] ?? '', - // 'Mensagem', - // visitaWrapItem['VTE_ID'] ?? '', - // ); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], - ); - }); + Navigator.pop(context); + Navigator.pop(context); + context.pushNamed( + 'scheduleCompleteVisitPage', + queryParameters: { + 'visitorStrList': serializeParam( + visitaWrapItem['VTE_DOCUMENTO'], + ParamType.String, + ), + 'visitorJsonList': serializeParam( + [visitaWrapItem], + ParamType.JSON, + isList: true, + ), + }.withoutNulls, + ); }, ), - if (getStatus(visitaWrapItem['VAW_STATUS']) == false) // SHARE ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) // SHARE ACTION FlutterFlowIconButton( icon: const Icon(Icons.share), onPressed: () async { - Share.share(r''' - Olá ${visitaWrapItem['VTE_NOME']} - Você foi convidado para ${visitaWrapItem['NAC_DESCRICAO']} + Share.share(''' +Olá, \*${visitaWrapItem['VTE_NOME']}\*! Você foi convidado para \*${visitaWrapItem['NAC_DESCRICAO']}\*. - Validade do Convite: - visitaWrapItem['VAW_DTINICIO'] - visitaWrapItem['VAW_DTFIM'] +\*Validade do Convite\*: +- Início: ${visitaWrapItem['VAW_DTINICIO']} +- Fim: ${visitaWrapItem['VAW_DTFIM']} - URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']} +URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']} '''); }, ), - - // if (getStatus(visitaWrapItem['VAW_STATUS']) == null) // SEND ACTION - // FlutterFlowIconButton( - // icon: const Icon(Icons.send), - // onPressed: () async { - // showDialog( - // context: context, - // builder: (context) { - // return AlertDialog( - // title: Text( - // FFLocalizations.of(context).getVariableText( - // ptText: 'Bloquear Visita', - // enText: 'Block Visit', - // ), - // ), - // content: Text( - // FFLocalizations.of(context).getVariableText( - // ptText: - // 'Você tem certeza que deseja bloquear essa visita?', - // enText: 'Are you sure you want to block this visit?', - // ), - // ), - // backgroundColor: - // FlutterFlowTheme.of(context).primaryBackground, - // actions: [ - // FFButtonWidget( - // text: FFLocalizations.of(context).getVariableText( - // enText: 'No', - // ptText: 'Não', - // ), - // onPressed: () { - // Navigator.pop(context); - // }, - // options: FFButtonOptions( - // width: 100, - // height: 40, - // color: - // FlutterFlowTheme.of(context).primaryBackground, - // textStyle: TextStyle( - // color: FlutterFlowTheme.of(context).primaryText, - // ), - // borderSide: BorderSide( - // color: FlutterFlowTheme.of(context) - // .primaryBackground, - // width: 1, - // ), - // borderRadius: BorderRadius.circular(10)), - // ), - // FFButtonWidget( - // text: FFLocalizations.of(context).getVariableText( - // enText: 'Yes', - // ptText: 'Sim', - // ), - // onPressed: () async { - // // await changeStatusAction?.call( - // // context, - // // 'B', - // // visitaWrapItem['VAW_REF'] ?? '', - // // 'Mensagem', - // // visitaWrapItem['VTE_ID'] ?? '', - // // ); - // }, - // options: FFButtonOptions( - // width: 100, - // height: 40, - // color: FlutterFlowTheme.of(context).primaryBackground, - // textStyle: TextStyle( - // color: FlutterFlowTheme.of(context).primaryText, - // ), - // borderSide: BorderSide( - // color: - // FlutterFlowTheme.of(context).primaryBackground, - // width: 1, - // ), - // borderRadius: BorderRadius.circular(10), - // ), - // ), - // ], - // ); - // }); - // }, - // ), ], labelsHashMap: Map.from({ 'Nome': visitaWrapItem['VTE_NOME'] ?? '', @@ -389,27 +265,48 @@ Widget buildDetails( 'value': 'E', }), statusHashMap: [ - getStatus(visitaWrapItem['VAW_STATUS']) == true - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : getStatus(visitaWrapItem['VAW_STATUS']) == null - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ): FlutterFlowTheme.of(context).alternate, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.canceled) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.finished) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.inactive) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }), ], - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], ); } diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 3440eb7b..f1cc977d 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -154,136 +154,142 @@ class _RegisiterVistorTemplateComponentWidgetState Padding( padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autovalidateMode: AutovalidateMode.onUserInteraction, - autofocus: false, - textCapitalization: TextCapitalization.none, - autofillHints: const [AutofillHints.password], - keyboardType: TextInputType.number, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, + child: Column(children: [ + TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( + style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + FlutterFlowTheme.of(context).bodyMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), + validator: + _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController2Validator.asValidator(context), - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')), - ], - ), - ), - FutureBuilder( - future: _model.textController2.text.isNotEmpty - ? _model.getVisitanteByDocument( - _model.textController2.text, context) - : null, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const SizedBox(); - } else if (snapshot.hasError || - snapshot.data == null || - snapshot.data == '') { - // safeSetState(() => _isVisitorRegistered = false); - _isVisitorRegistered = false; - visitorAlreadyRegistered.add(true); - return const SizedBox(); - } else { - _isVisitorRegistered = true; - visitorAlreadyRegistered.add(false); - return _model.textController2.text.isEmpty - ? const SizedBox() - : Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.only( - right: MediaQuery.sizeOf(context).width * - 0.1), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Visitor already registered', - ptText: 'Visitante já cadastrado', - ), - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .error, - fontSize: 14.0, - letterSpacing: 0.0, - )), - ), - ], - ); - } - }, + FutureBuilder( + future: _model.textController2.text.isNotEmpty + ? _model.getVisitanteByDocument( + _model.textController2.text, context) + : null, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const SizedBox(); + } else if (snapshot.hasError || + snapshot.data == null || + snapshot.data == '') { + // safeSetState(() => _isVisitorRegistered = false); + _isVisitorRegistered = false; + visitorAlreadyRegistered.add(true); + return const SizedBox(); + } else { + _isVisitorRegistered = true; + visitorAlreadyRegistered.add(false); + return _model.textController2.text.isEmpty + ? const SizedBox() + : Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.only( + top: 5, start: 12), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: + 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito', + color: Color.alphaBlend( + Colors.white + .withOpacity(0.7), + Colors.red), + fontSize: 13.0, + letterSpacing: 0.0, + )), + ), + ], + ); + } + }, + ), + ]), ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( @@ -419,26 +425,33 @@ class _RegisiterVistorTemplateComponentWidgetState ), if (_model.dropDownValue == null || _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ), - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - color: FlutterFlowTheme.of(context) - .customColor6, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodySmallFamily), - )), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional.only( + top: 5, start: 15), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), + ), + ], ), ], ), diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 2020de23..bc39e658 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -73,23 +73,6 @@ class _VisitDetailsModalTemplateComponentWidgetState @override Widget build(BuildContext context) { - log('------------------ VisitDetailsModalTemplateComponentWidget ------------------'); - log('visitStatusStr: ${widget.visitStatusStr}'); - log('visitStartDateStr: ${widget.visitStartDateStr}'); - log('visitEndDateStr: ${widget.visitEndDateStr}'); - log('visitReasonStr: ${widget.visitReasonStr}'); - log('visitLevelStr: ${widget.visitLevelStr}'); - log('visitTempStr: ${widget.visitTempStr}'); - log('visitObsStr: ${widget.visitObsStr}'); - log('visitorStrList: ${widget.visitorStrList}'); - log('visitorJsonList: ${widget.visitorJsonList}'); - log('visitorImgPath: ${widget.visitorImgPath}'); - log('visitorImgList: ${widget.visitorImgList}'); - log('visitIdStr: ${widget.visitIdStr}'); - log('updateToggleIdx: ${widget.updateToggleIdx}'); - log('repeatVisitSchedule: ${widget.repeatVisitSchedule}'); - log('visitStatusColor: ${widget.visitStatusColor}'); - log('-----------------------------------------------------------------------------'); return Builder( builder: (context) { if (widget.visitStatusStr != null && widget.visitStatusStr != '') { diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index a7936422..40ef200a 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -98,51 +98,120 @@ class PreferencesPageModel with ChangeNotifier { } void toggleNotify(BuildContext context) { - FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - notifica: FFAppState().notify ? 'S' : 'N', - ) - .then((value) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + title: Text( FFLocalizations.of(context).getVariableText( - ptText: 'Notificação alterada com sucesso', - enText: 'Notification changed successfully', + enText: FFAppState().notify + ? 'Access Notification' + : 'Disable Access Notification', + ptText: FFAppState().notify + ? 'Notificação de acesso' + : 'Desativar notificação de acesso', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).catchError((err) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( + ), + content: Text( FFLocalizations.of(context).getVariableText( - enText: 'Error changing notification', - ptText: 'Erro ao alterar notificação', + ptText: 'Tem certeza que deseja desvincular este dispositivo?', + enText: 'Are you sure you want to unlink this device?', ), - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }); + ), + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().notify = !FFAppState().notify; + PhpGroup.changeNotifica + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + notifica: FFAppState().notify ? 'S' : 'N', + ) + .then((value) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Notificação alterada com sucesso', + enText: 'Notification changed successfully', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Unlink', + ptText: 'Desvincular', + ), + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); notifyListeners(); } diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 7253a8c6..fbd53d4f 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -160,12 +160,24 @@ class _ScheduleCompleteVisitPageWidgetState } } -bool? getStatus(dynamic data) { - return data == 'A' - ? true - : data == 'F' || data == 'B' || data == 'C' || data == 'I' - ? null - : false; +enum status { active, unknown, canceled, finished, blocked, inactive } + +status? getStatus(dynamic data) { + debugPrint('getStatus: $data'); + switch (data) { + case 'A': + return status.active; + case 'F': + return status.finished; + case 'B': + return status.blocked; + case 'C': + return status.canceled; + case 'I': + return status.inactive; + default: + return status.unknown; + } } PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { @@ -1739,28 +1751,54 @@ Widget visitHistory( 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', }), statusHashMap: [ - getStatus(visitaWrapItem['VAW_STATUS']) == true - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : getStatus(visitaWrapItem['VAW_STATUS']) == null - ? Map.from({ - FFLocalizations.of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - }) - : Map.from({ - FFLocalizations.of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.unknown) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.canceled) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.blocked) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.inactive) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Inactive', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }), ], onTapCardItemAction: () async { showModalBottomSheet( From a5255f4f069233a012d74f6cf33c5dd616e08ddb Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 13:52:36 -0300 Subject: [PATCH 28/72] chore: Update preferences settings UI --- .../preferences_settings_model.dart | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 40ef200a..2cb78e00 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -105,32 +105,34 @@ class PreferencesPageModel with ChangeNotifier { backgroundColor: FlutterFlowTheme.of(context).primaryBackground, title: Text( FFLocalizations.of(context).getVariableText( - enText: FFAppState().notify - ? 'Access Notification' - : 'Disable Access Notification', - ptText: FFAppState().notify - ? 'Notificação de acesso' - : 'Desativar notificação de acesso', - ), + enText: FFAppState().notify + ? 'Disable Access Notification' + : 'Access Notification', + ptText: FFAppState().notify + ? 'Desativar notificação de acesso' + : 'Notificação de acesso'), ), content: Text( FFLocalizations.of(context).getVariableText( - ptText: 'Tem certeza que deseja desvincular este dispositivo?', - enText: 'Are you sure you want to unlink this device?', - ), + ptText: FFAppState().notify + ? 'Tem certeza que deseja desativar as suas notificações de acesso?' + : 'Tem certeza que deseja receber as suas notificações de acesso?', + enText: FFAppState().notify + ? 'Are you sure you want to disable your access notifications?' + : 'Are you sure you want to receive your access notifications?'), ), actions: [ FFButtonWidget( text: FFLocalizations.of(context).getVariableText( - enText: 'Cancel', - ptText: 'Cancelar', + enText: 'No', + ptText: 'Não', ), onPressed: () { Navigator.pop(context); }, options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, @@ -190,14 +192,15 @@ class PreferencesPageModel with ChangeNotifier { ), ); }).whenComplete(() => notifyListeners()); + Navigator.pop(context); }, text: FFLocalizations.of(context).getVariableText( - enText: 'Unlink', - ptText: 'Desvincular', + enText: 'Yes', + ptText: 'Sim', ), options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, @@ -243,8 +246,8 @@ class PreferencesPageModel with ChangeNotifier { Navigator.pop(context); }, options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, @@ -300,8 +303,8 @@ class PreferencesPageModel with ChangeNotifier { ptText: 'Desvincular', ), options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, @@ -341,8 +344,8 @@ class PreferencesPageModel with ChangeNotifier { FFButtonWidget( onPressed: () => Navigator.pop(context), options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, @@ -401,8 +404,8 @@ class PreferencesPageModel with ChangeNotifier { notifyListeners(); }, options: FFButtonOptions( - width: 100, - height: 40, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, From 2aff585c0cc0fc00e4736ebce5e762d2d93b9552 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 13:56:45 -0300 Subject: [PATCH 29/72] WIP --- .../preferences_settings_model.dart | 179 +++++++++--------- 1 file changed, 93 insertions(+), 86 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 2cb78e00..5fa0ab73 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -122,97 +122,104 @@ class PreferencesPageModel with ChangeNotifier { : 'Are you sure you want to receive your access notifications?'), ), actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', ), - borderSide: BorderSide( + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().notify = !FFAppState().notify; + PhpGroup.changeNotifica + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + notifica: FFAppState().notify ? 'S' : 'N', + ) + .then((value) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Notificação alterada com sucesso', + enText: 'Notification changed successfully', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - notifica: FFAppState().notify ? 'S' : 'N', - ) - .then((value) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Notificação alterada com sucesso', - enText: 'Notification changed successfully', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).catchError((err) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error changing notification', - ptText: 'Erro ao alterar notificação', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).whenComplete(() => notifyListeners()); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), + ].divide(const SizedBox(width: 2)), ), - ], + ].divide(const SizedBox(width: 2)), ); }); notifyListeners(); From 6188330b041c331751e6de3212dcfefae1016db7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 13:58:38 -0300 Subject: [PATCH 30/72] WIP --- .../preferences_settings_page/preferences_settings_model.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 5fa0ab73..680d5781 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -135,6 +135,7 @@ class PreferencesPageModel with ChangeNotifier { Navigator.pop(context); }, options: FFButtonOptions( + elevation: 0, width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, @@ -204,6 +205,7 @@ class PreferencesPageModel with ChangeNotifier { ptText: 'Sim', ), options: FFButtonOptions( + elevation: 0, width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, @@ -219,7 +221,7 @@ class PreferencesPageModel with ChangeNotifier { ), ].divide(const SizedBox(width: 2)), ), - ].divide(const SizedBox(width: 2)), + ], ); }); notifyListeners(); From 6a2bda3b38df9b4b9939961b690dcbfba76eb507 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 14:02:56 -0300 Subject: [PATCH 31/72] add AlertDialog in ToggleAccessNotification --- .../preferences_settings_model.dart | 350 ++++++++---------- 1 file changed, 162 insertions(+), 188 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 680d5781..62911c21 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -219,7 +219,7 @@ class PreferencesPageModel with ChangeNotifier { borderRadius: BorderRadius.circular(10), ), ), - ].divide(const SizedBox(width: 2)), + ], ), ], ); @@ -246,84 +246,90 @@ class PreferencesPageModel with ChangeNotifier { ), ), actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Cancel', - ptText: 'Cancelar', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - onPressed: () async { - PhpGroup.resopndeVinculo - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - tarefa: 'I', - ) - // ignore: body_might_complete_normally_catch_error - .catchError((err, stack) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error unlinking device', - ptText: 'Erro ao desvincular dispositivo', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).then( - (value) { - FFAppState().deleteCliUUID(); - FFAppState().deleteLocal(); - FFAppState().deleteOwnerUUID(); - Navigator.pop(context); + onPressed: () { Navigator.pop(context); }, - ); - notifyListeners(); - }, - text: FFLocalizations.of(context).getVariableText( - enText: 'Unlink', - ptText: 'Desvincular', - ), - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, + FFButtonWidget( + onPressed: () async { + PhpGroup.resopndeVinculo + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + tarefa: 'I', + ) + // ignore: body_might_complete_normally_catch_error + .catchError((err, stack) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + Navigator.pop(context); + }, + ); + notifyListeners(); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Unlink', + ptText: 'Desvincular', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), ), - borderRadius: BorderRadius.circular(10), - ), + ], ), ], ); @@ -350,128 +356,96 @@ class PreferencesPageModel with ChangeNotifier { ), ), actions: [ - FFButtonWidget( - onPressed: () => Navigator.pop(context), - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - text: FFLocalizations.of(context).getVariableText( - enText: 'Cancel', - ptText: 'Cancelar', - ), - ), - FFButtonWidget( - onPressed: () { - PhpGroup.deleteAccount - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ) - .then((value) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }).catchError((err) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error deleting account', - ptText: 'Erro ao deletar conta', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () => Navigator.pop(context), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, ), - ); - }); - notifyListeners(); - }, - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'Cancel', + ptText: 'Cancelar', + ), ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, + FFButtonWidget( + onPressed: () { + PhpGroup.deleteAccount + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ) + .then((value) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }).catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error deleting account', + ptText: 'Erro ao deletar conta', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); + notifyListeners(); + }, + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'Delete', + ptText: 'Deletar', + ), ), - borderRadius: BorderRadius.circular(10), - ), - text: FFLocalizations.of(context).getVariableText( - enText: 'Delete', - ptText: 'Deletar', - ), + ], ), ], ); }); notifyListeners(); - - // PhpGroup.deleteAccount - // .call( - // devUUID: FFAppState().devUUID, - // userUUID: FFAppState().userUUID, - // ) - // .then((value) { - // FFAppState().deleteAll(); - // FFAppState().isLogged = false; - // context.goNamed( - // 'welcomePage', - // extra: { - // kTransitionInfoKey: const TransitionInfo( - // hasTransition: true, - // transitionType: PageTransitionType.scale, - // alignment: Alignment.bottomCenter, - // ), - // }, - // ); - // }).catchError((err) { - // log(err.toString()); - // ScaffoldMessenger.of(context).showSnackBar( - // SnackBar( - // content: Text( - // FFLocalizations.of(context).getVariableText( - // ptText: 'Erro ao deletar dispositivo', - // enText: 'Error deleting device', - // ), - // style: TextStyle(color: FlutterFlowTheme.of(context).info)), - // backgroundColor: FlutterFlowTheme.of(context).error, - // duration: const Duration(seconds: 3), - // behavior: SnackBarBehavior.floating, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(30), - // ), - // ), - // ); - // }); } Future togglePass(BuildContext context) async { From 87e092a070bdc782735a9af2d249125bdface4ad Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 17:00:57 -0300 Subject: [PATCH 32/72] WIP --- lib/actions/actions.dart | 7 +- .../pushNotificationService.dart | 176 +++++++++++++- .../menu_component/menu_component_widget.dart | 227 +++++++++++++----- .../details_component_action.dart | 102 +------- .../liberation_history_widget.dart | 195 ++++++++++++++- .../preferences_settings_model.dart | 8 +- 6 files changed, 550 insertions(+), 165 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index a9f15c57..ecd87cf3 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -343,8 +343,9 @@ Future visitRequestComponentAction( ); if (respondeSolicitacaoCall.statusCode == 200) { - log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID'); - return true; + log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID; status: ${respondeSolicitacaoCall.jsonBody['error']}'); + + return !respondeSolicitacaoCall.jsonBody['error']; } else { log('headers: ${respondeSolicitacaoCall.headers}'); log('bodyText: ${respondeSolicitacaoCall.bodyText}'); @@ -464,8 +465,10 @@ Future changeStatusAction( if (!context.mounted) return; if (approveVisitRequest == true) { log('Aprovado'); + context.pop(); } else { log('Erro ao aprovar'); + context.pop(); } break; case 'B': diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index ac25aea2..411682e9 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -15,6 +15,7 @@ import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.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'; @@ -448,7 +449,176 @@ class NotificationHandler { vteUUID: message['idVisitante'].toString(), vawRef: message['referencia'].toString(), vawStatus: 'S', - buttons: [], + buttons: [ + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Aprovar Visita', + enText: 'Approve Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: + 'Are you sure you want to approve this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await changeStatusAction.call( + context, + 'L', + message['referencia'].toString(), + 'Mensagem', + message['idVisitante'].toString(), + ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: + FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + FlutterFlowIconButton( + icon: const Icon(Icons.close), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: + 'Are you sure you want to block this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await changeStatusAction.call( + context, + 'B', + message['referencia'].toString(), + 'Mensagem', + message['idVisitante'].toString(), + ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: + FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + ], labelsHashMap: Map.from({ FFLocalizations.of(context).getVariableText( enText: 'Visitor', @@ -470,8 +640,8 @@ class NotificationHandler { statusHashMap: [ { FFLocalizations.of(context).getVariableText( - enText: 'Pending', - ptText: 'Pendente', + enText: 'Active', + ptText: 'Ativo', ): FlutterFlowTheme.of(context).warning, }, ], diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index 5839264c..91b722e8 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -13,17 +13,16 @@ import 'package:flutter/material.dart'; import 'menu_component_model.dart'; export 'menu_component_model.dart'; - class MenuComponentWidget extends StatefulWidget { const MenuComponentWidget({ - Key? key, - required this.style, - required this.item, - required this.expandable, - }); - final MenuView style; - final MenuItem item; - final bool expandable; + Key? key, + required this.style, + required this.item, + required this.expandable, + }); + final MenuView style; + final MenuItem item; + final bool expandable; @override State createState() => _MenuComponentWidgetState(); } @@ -31,11 +30,8 @@ class MenuComponentWidget extends StatefulWidget { class _MenuComponentWidgetState extends State { late MenuComponentModel _model; - - @override void setState(VoidCallback callback) { - super.setState(callback); _model.onUpdate(); } @@ -44,7 +40,6 @@ class _MenuComponentWidgetState extends State { void initState() { super.initState(); _model = createModel(context, () => MenuComponentModel()); - } @override @@ -57,43 +52,165 @@ class _MenuComponentWidgetState extends State { @override Widget build(BuildContext context) { final options = widget.item == MenuItem.button - ? [ - MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),), + ? [ + MenuButtonWidget( + icon: FFIcons.kvector1, + action: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Schedule\nVisit', + ptText: 'Agendar\nVisita', + ), + ), - MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),), + MenuButtonWidget( + icon: FFIcons.khome, + action: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register\nVisitor', + ptText: 'Cadastro\nde Visitante', + ), + ), - // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), - // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), + // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), - MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),), + MenuButtonWidget( + icon: Icons.qr_code, + action: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'QRCode\nAccess', + ptText: 'QRCode\nde Acesso', + ), + ), - MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),), + MenuButtonWidget( + icon: Icons.people, + action: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Poeple on\nthe Property', + ptText: 'Pessoas na\nPropriedade', + ), + ), - MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),), + MenuButtonWidget( + icon: Icons.history_sharp, + action: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Consult\nHistories', + ptText: 'Consultar\nHistóricos', + ), + ), - MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),), - ] : [ - MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),), + MenuButtonWidget( + icon: Icons.settings, + action: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Preferences\nSettings', + ptText: 'Preferências \nde Configurações', + ), + ), + ] + : [ + MenuCardItem( + icon: FFIcons.kvector1, + action: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Schedule\nVisit', + ptText: 'Agendar\nVisita', + ), + ), - MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),), + MenuCardItem( + icon: FFIcons.khome, + action: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register\nVisitor', + ptText: 'Cadastro\nde Visitante', + ), + ), - // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), - // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), + // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), - MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),), + MenuCardItem( + icon: Icons.qr_code, + action: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'QRCode\nAccess', + ptText: 'QRCode\nde Acesso', + ), + ), - MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),), + MenuCardItem( + icon: Icons.people, + action: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Poeple on\nthe Property', + ptText: 'Pessoas\nna Propriedade', + ), + ), - MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),), + MenuCardItem( + icon: Icons.history_sharp, + action: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Consult\nHistories', + ptText: 'Consultar\nHistoricos', + ), + ), - MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),), - - ]; + MenuCardItem( + icon: Icons.settings, + action: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Preferences\nSettings', + ptText: 'Preferências\nde Configuração', + ), + ), + ]; return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Builder( builder: (context) { - if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (widget.style == MenuView.list_grid && + widget.expandable == true && + widget.item == MenuItem.button) { if (_model.isGrid == true) { return wrapWithModel( model: _model.menuListViewComponentModel, @@ -125,30 +242,32 @@ class _MenuComponentWidgetState extends State { ), ); } - } - if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - options: options, - expandable: widget.expandable, - item: widget.item, - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - ), - ); + } + if (widget.style == MenuView.list && + widget.expandable == false && + widget.item == MenuItem.card) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); } return const SizedBox(); - }, + }, ), ); } - Future accessQRCodeOptAction(BuildContext context) async { + Future accessQRCodeOptAction(BuildContext context) async { context.pushNamed( 'qrCodePage', extra: { @@ -160,6 +279,4 @@ class _MenuComponentWidgetState extends State { }, ); } - - -} \ No newline at end of file +} diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 53ce841e..0997c02d 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -51,88 +51,6 @@ Widget buildDetails( vawRef: 'Lorem Ipsus', changeStatusAction: changeStatusAction, buttons: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.active) // ACCEPT ACTION - FlutterFlowIconButton( - icon: const Icon(Icons.done), - onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Aprovar Visita', - enText: 'Approve Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja aprovar essa visita?', - enText: 'Are you sure you want to approve this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: - FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - await changeStatusAction?.call( - context, - 'L', - visitaWrapItem['VAW_ID'] ?? '', - 'Mensagem', - visitaWrapItem['VTE_DOCUMENTO'] ?? '', - ); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], - ); - }); - }, - ), if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // REJECT ACTION FlutterFlowIconButton( @@ -187,13 +105,13 @@ Widget buildDetails( ptText: 'Sim', ), onPressed: () async { - // await changeStatusAction?.call( - // context, - // 'B', - // visitaWrapItem['VAW_REF'] ?? '', - // 'Mensagem', - // visitaWrapItem['VTE_ID'] ?? '', - // ); + await changeStatusAction?.call( + context, + 'B', + visitaWrapItem['VAW_REF'] ?? '', + 'Mensagem', + visitaWrapItem['VTE_ID'] ?? '', + ); }, options: FFButtonOptions( width: 100, @@ -215,8 +133,8 @@ Widget buildDetails( }); }, ), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) // RECALL ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) != + status.active) // RECALL ACTION FlutterFlowIconButton( icon: const Icon(Icons.refresh), onPressed: () async { @@ -239,7 +157,7 @@ Widget buildDetails( }, ), if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) // SHARE ACTION + status.active) // SHARE ACTION FlutterFlowIconButton( icon: const Icon(Icons.share), onPressed: () async { diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 005a3b6b..c13695f9 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -12,6 +12,7 @@ import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.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/nav/nav.dart'; import 'package:cached_network_image/cached_network_image.dart'; @@ -310,8 +311,8 @@ Widget liberationHistoryItemCard( liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', + ptText: 'Finalizado', + enText: 'Finished', ): FlutterFlowTheme.of(context).success, }) : liberationHistoryItem['NOT_STATUS'] == 'B' @@ -323,12 +324,13 @@ Widget liberationHistoryItemCard( }) : Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', + ptText: 'Ativo', + enText: 'Active', ): FlutterFlowTheme.of(context).warning, }) ], onTapCardItemAction: () async { + log('LiberationItem: $liberationHistoryItem'); showModalBottomSheet( isScrollControlled: true, isDismissible: true, @@ -358,13 +360,188 @@ Widget liberationHistoryItemCard( 'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'], // 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'], }), - buttons: [], + buttons: [ + if (liberationHistoryItem['NOT_STATUS'] == 'S') + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Aprovar Visita', + enText: 'Approve Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: + 'Are you sure you want to approve this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: + FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: + FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await changeStatusAction.call( + context, + 'L', + liberationHistoryItem['NOT_ID'].toString(), + 'Mensagem', + liberationHistoryItem['VTE_ID'].toString(), + ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + if (liberationHistoryItem['NOT_STATUS'] == 'S') + FlutterFlowIconButton( + icon: const Icon(Icons.close), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: + 'Are you sure you want to block this visit?', + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).primaryBackground, + actions: [ + FFButtonWidget( + text: + FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: + FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await changeStatusAction.call( + context, + 'B', + liberationHistoryItem['NOT_ID'].toString(), + 'Mensagem', + liberationHistoryItem['VTE_ID'].toString(), + ); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + ], statusHashMap: [ liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', + ptText: 'Finalizado', + enText: 'Finished', ): FlutterFlowTheme.of(context).success, }) : liberationHistoryItem['NOT_STATUS'] == 'B' @@ -376,8 +553,8 @@ Widget liberationHistoryItemCard( }) : Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', + ptText: 'Ativo', + enText: 'Active', ): FlutterFlowTheme.of(context).warning, }) ], diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 62911c21..d8f0364e 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -516,10 +516,10 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - FFAppState().pass = false; + // FFAppState().pass = false; } }).catchError((error, StackTrace) { - FFAppState().pass = false; + // FFAppState().pass = false; log(error.toString()); log(StackTrace.toString()); ScaffoldMessenger.of(context).showSnackBar( @@ -608,10 +608,10 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - FFAppState().panic = false; + // FFAppState().panic = false; } }).catchError((e, s) { - FFAppState().panic = false; + // FFAppState().panic = false; log(e.toString()); log(s.toString()); From cf79bff8e4bca64ca3b27986a2767a59f29f5545 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 17:36:29 -0300 Subject: [PATCH 33/72] FIX: internet connection exception in settings --- .../preferences_settings_model.dart | 126 ++++++++++++------ 1 file changed, 86 insertions(+), 40 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index d8f0364e..7b73aec2 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -273,15 +273,47 @@ class PreferencesPageModel with ChangeNotifier { ), FFButtonWidget( onPressed: () async { - PhpGroup.resopndeVinculo - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - tarefa: 'I', - ) - // ignore: body_might_complete_normally_catch_error - .catchError((err, stack) { + try { + await PhpGroup.resopndeVinculo + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + tarefa: 'I', + ) + // ignore: body_might_complete_normally_catch_error + .catchError((err, stack) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + Navigator.pop(context); + }, + ); + notifyListeners(); + } catch (err, stack) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( @@ -300,16 +332,7 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - }).then( - (value) { - FFAppState().deleteCliUUID(); - FFAppState().deleteLocal(); - FFAppState().deleteOwnerUUID(); - Navigator.pop(context); - Navigator.pop(context); - }, - ); - notifyListeners(); + } }, text: FFLocalizations.of(context).getVariableText( enText: 'Unlink', @@ -381,26 +404,50 @@ class PreferencesPageModel with ChangeNotifier { ), ), FFButtonWidget( - onPressed: () { - PhpGroup.deleteAccount - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ) - .then((value) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, + onPressed: () async { + try { + await PhpGroup.deleteAccount + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ) + .then((value) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }).catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error deleting account', + ptText: 'Erro ao deletar conta', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), ), - }, - ); - }).catchError((err) { + ); + }); + notifyListeners(); + } catch (err, stack) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( @@ -419,8 +466,7 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - }); - notifyListeners(); + } }, options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, From 3ed50939d0d5a50fface2e5252393ec3879497a3 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 17:52:30 -0300 Subject: [PATCH 34/72] WIP --- .../preferences_settings_model.dart | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 7b73aec2..80790cbc 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -281,6 +281,34 @@ class PreferencesPageModel with ChangeNotifier { cliID: FFAppState().cliUUID, tarefa: 'I', ) + .then((value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + Navigator.pop(context); + + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Device unlinked successfully', + ptText: + 'Dispositivo desvinculado com sucesso', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }) // ignore: body_might_complete_normally_catch_error .catchError((err, stack) { log(err.toString()); @@ -303,15 +331,7 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - }).then( - (value) { - FFAppState().deleteCliUUID(); - FFAppState().deleteLocal(); - FFAppState().deleteOwnerUUID(); - Navigator.pop(context); - Navigator.pop(context); - }, - ); + }); notifyListeners(); } catch (err, stack) { log(err.toString()); From 262b8dd63b2b7db5901d6aa46c2d51962e5fb5d7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 6 Aug 2024 17:56:50 -0300 Subject: [PATCH 35/72] WIP --- .../preferences_settings_model.dart | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 80790cbc..2d30ed52 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -291,14 +291,15 @@ class PreferencesPageModel with ChangeNotifier { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Device unlinked successfully', - ptText: - 'Dispositivo desvinculado com sucesso', - ), - style: TextStyle( - color: - FlutterFlowTheme.of(context).info)), + FFLocalizations.of(context).getVariableText( + enText: 'Device unlinked successfully', + ptText: + 'Dispositivo desvinculado com sucesso', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + ), + ), backgroundColor: FlutterFlowTheme.of(context).success, duration: const Duration(seconds: 3), @@ -308,20 +309,41 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); - }) - // ignore: body_might_complete_normally_catch_error - .catchError((err, stack) { + }).catchError((err, stack) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error unlinking device', - ptText: 'Erro ao desvincular dispositivo', - ), - style: TextStyle( - color: - FlutterFlowTheme.of(context).info)), + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + ), + ), + backgroundColor: + FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).catchError((err, stack) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + ), + ), backgroundColor: FlutterFlowTheme.of(context).error, duration: const Duration(seconds: 3), From 2a5acf1016c3c4587f5a932a86aca24c31ef056b Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 7 Aug 2024 10:22:48 -0300 Subject: [PATCH 36/72] WIP --- lib/actions/actions.dart | 3 +- lib/backend/api_requests/api_calls.dart | 60 +-- .../details_component_action.dart | 39 +- lib/flutter_flow/flutter_flow_util.dart | 24 +- .../preferences_settings_model.dart | 117 +++--- .../schedule_complete_visit_page_model.dart | 6 +- .../schedule_complete_visit_page_widget.dart | 391 +++++++++--------- .../visit_history_page_model.dart | 10 +- .../visit_history_page_widget.dart | 22 +- 9 files changed, 356 insertions(+), 316 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index ecd87cf3..49d9cda7 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -344,7 +344,6 @@ Future visitRequestComponentAction( if (respondeSolicitacaoCall.statusCode == 200) { log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID; status: ${respondeSolicitacaoCall.jsonBody['error']}'); - return !respondeSolicitacaoCall.jsonBody['error']; } else { log('headers: ${respondeSolicitacaoCall.headers}'); @@ -485,8 +484,10 @@ Future changeStatusAction( if (!context.mounted) return; if (blockVisitRequest == true) { log('Bloqueado'); + return true; } else { log('Erro ao bloquear'); + return false; } break; default: diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index b198f4d3..d6009dae 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -1370,39 +1370,53 @@ class PostProvVisitSchedulingCall { } class GetVisitsCall { - Future call({ + Stream call({ String? devUUID = '', String? userUUID = '', String? cliID = '', String? atividade = '', int? pageSize, int? pageNumber, - }) async { + }) { final baseUrl = PhpGroup.getBaseUrl(); + final StreamController controller = StreamController(); - return ApiManager.instance.makeApiCall( - callName: 'getVisits', - apiUrl: '$baseUrl/processRequest.php', - callType: ApiCallType.POST, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', + Future.microtask( + () async { + try { + final response = await ApiManager.instance.makeApiCall( + callName: 'getVisits', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + 'pageSize': pageSize, + 'pageNumber': pageNumber, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + controller.add(response); + controller.close(); + } catch (e) { + controller.addError(e); + controller.close(); + } }, - params: { - 'devUUID': devUUID, - 'userUUID': userUUID, - 'cliID': cliID, - 'atividade': atividade, - 'pageSize': pageSize, - 'pageNumber': pageNumber, - }, - bodyType: BodyType.X_WWW_FORM_URL_ENCODED, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, ); + + return controller.stream; } bool? error(dynamic response) => castToType(getJsonField( diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 0997c02d..bf7df5fe 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -5,6 +5,7 @@ import 'package:hub/app_state.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.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'; @@ -105,13 +106,47 @@ Widget buildDetails( ptText: 'Sim', ), onPressed: () async { - await changeStatusAction?.call( + await changeStatusAction + ?.call( context, 'B', visitaWrapItem['VAW_REF'] ?? '', 'Mensagem', visitaWrapItem['VTE_ID'] ?? '', - ); + ) + .then((value) { + Navigator.pop(context); + if (value == false) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error blocking visit', + ptText: 'Erro ao bloquear visita', + ), + true, + ); + } else if (value == true) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Success canceling visit', + ptText: 'Succeso ao cancelar visita', + ), + false, + ); + } + }).catchError((err, stack) { + debugPrint('Error: $err'); + debugPrint('Stack: $stack'); + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error blocking visit', + ptText: 'Erro ao bloquear visita', + ), + true, + ); + }); }, options: FFButtonOptions( width: 100, diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 8a3cc1be..b2c3e3fb 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:collection/collection.dart'; import 'package:from_css_color/from_css_color.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'dart:math' show pow, pi, sin; import 'package:intl/intl.dart'; import 'package:json_path/json_path.dart'; @@ -505,7 +506,8 @@ void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => void showSnackbar( BuildContext context, - String message, { + String message, + bool error, { bool loading = false, int duration = 4, }) { @@ -515,20 +517,32 @@ void showSnackbar( content: Row( children: [ if (loading) - const Padding( - padding: EdgeInsetsDirectional.only(end: 10.0), + Padding( + padding: const EdgeInsetsDirectional.only(end: 10.0), child: SizedBox( height: 20, width: 20, child: CircularProgressIndicator( - color: Colors.white, + color: FlutterFlowTheme.of(context).info, ), ), ), - Text(message), + Text( + message, + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + ), + ), ], ), duration: Duration(seconds: duration), + backgroundColor: error + ? FlutterFlowTheme.of(context).error + : FlutterFlowTheme.of(context).success, + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), ), ); } diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 2d30ed52..1a3ff528 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -282,68 +282,49 @@ class PreferencesPageModel with ChangeNotifier { tarefa: 'I', ) .then((value) { - FFAppState().deleteCliUUID(); - FFAppState().deleteLocal(); - FFAppState().deleteOwnerUUID(); - Navigator.pop(context); - Navigator.pop(context); + log(value.jsonBody['error'].toString()); + if (value.jsonBody['error'] == false) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + Navigator.pop(context); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Device unlinked successfully', - ptText: - 'Dispositivo desvinculado com sucesso', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info, + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Device unlinked successfully', + ptText: + 'Dispositivo desvinculado com sucesso', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), ), ), - backgroundColor: - FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).catchError((err, stack) { + ); + } + }) + // ignore: body_might_complete_normally_catch_error + .catchError((err, stack) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error unlinking device', - ptText: 'Erro ao desvincular dispositivo', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info, - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).catchError((err, stack) { - log(err.toString()); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error unlinking device', - ptText: 'Erro ao desvincular dispositivo', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info, - ), - ), + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), backgroundColor: FlutterFlowTheme.of(context).error, duration: const Duration(seconds: 3), @@ -454,18 +435,20 @@ class PreferencesPageModel with ChangeNotifier { userUUID: FFAppState().userUUID, ) .then((value) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + if (value.jsonBody['error'] == false) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } }).catchError((err) { log(err.toString()); ScaffoldMessenger.of(context).showSnackBar( diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 23a7f0d0..022d79b9 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -12,11 +12,11 @@ import 'package:intl/intl.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { - final _visitHistoryManager = FutureRequestManager(); - Future visitHistory({ + final _visitHistoryManager = StreamRequestManager(); + Stream visitHistory({ String? uniqueQueryKey, bool? overrideCache, - required Future Function() requestFn, + required Stream Function() requestFn, }) => _visitHistoryManager.performRequest( uniqueQueryKey: uniqueQueryKey, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index fbd53d4f..79647877 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -1694,204 +1696,201 @@ Widget visitHistory( decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, ), - child: SingleChildScrollView( - child: FutureBuilder( - future: _model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - ), + child: StreamBuilder( + stream: _model.visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + pageSize: 100, + pageNumber: 1, ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - // visitaWrap.length, (visitaWrapIndex) { - - return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }), - labelsHashMap: Map.from({ - 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', - 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', - 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', - }), - statusHashMap: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.active) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).warning, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Finalizado', - enText: 'Finished', - ): FlutterFlowTheme.of(context).success, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.unknown) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.canceled) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.blocked) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.inactive) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Inactive', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).error, - }), - ], - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return buildDetails( - visitaWrapItem, - context, - changeStatusAction, - ); - }, - ).then((_) { - // PushNotificationManager _pushNotificationService = - // PushNotificationManager(); - // _pushNotificationService.onMessageReceived - // .listen((received) { - // if (received.data['click_action'] == - // 'cancel_request') { - // log('Aprovado'); - // _pushNotificationService.dispose(); - // snackbar(context, opt: true); - // context.pushReplacementNamed( - // 'liberationHistory', - // extra: { - // kTransitionInfoKey: const TransitionInfo( - // hasTransition: true, - // transitionType: PageTransitionType.scale, - // alignment: Alignment.bottomCenter, - // ), - // }, - // ); - // } - // }); - }); - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: true, - // isDismissible: true, - // useSafeArea: true, - // context: context, - // builder: (context) { - // return GestureDetector( - // onTap: () => _model.unfocusNode.canRequestFocus - // ? FocusScope.of(context) - // .requestFocus(_model.unfocusNode) - // : FocusScope.of(context).unfocus(), - // child: VisitDetailsModalTemplateComponentWidget( - // visitStatusStr: visitaWrapItem['VAW_STATUS'], - // visitStartDateStr: - // visitaWrapItem['VAW_DTINICIO'], - // visitEndDateStr: visitaWrapItem['VAW_DTFIM'], - // visitReasonStr: - // visitaWrapItem['MOT_DESCRICAO'], - // visitLevelStr: - // visitaWrapItem['NAC_DESCRICAO'], - // visitTempStr: - // visitaWrapItem['VTE_UNICA'].toString(), - // visitObsStr: visitaWrapItem['VAW_OBS'], - // visitorImgPath: valueOrDefault( - // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - // visitaWrapItem, - // r'''$.VTE_DOCUMENTO''', - // ).toString()}&tipo=E", - // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - // ), - // visitorStrList: - // visitaWrapItem['VTE_DOCUMENTO'], - // visitIdStr: visitaWrapItem['VAW_ID'], - // visitStatusColor: - // visitaWrapItem['VAW_STATUS'] == 'A' - // ? FlutterFlowTheme.of(context).success - // : FlutterFlowTheme.of(context).error, - // visitorJsonList: - // PhpGroup.getVisitsCall.visitasList( - // wrapGetVisitsResponse.jsonBody, - // ), - // updateToggleIdx: () async {}, - // repeatVisitSchedule: () async {}, - // ), - // ); - // }, - // ).then((value) => safeSetState(() {})); - }); - }); - }, - ); - }, ), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), + )); + } else if (snapshot.hasError) { + log('Error: ${snapshot.error}'); + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { + log('No data or jsonBody is null'); + return const Center(child: Text('No visits found')); + } + + final wrapGetVisitsResponse = snapshot.data!; + log('Response: ${wrapGetVisitsResponse.jsonBody}'); + + final visitaWrap = PhpGroup.getVisitsCall + .visitasList(wrapGetVisitsResponse.jsonBody) + ?.toList() ?? + []; + log('visitaWrap: $visitaWrap'); + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const BouncingScrollPhysics(), + addAutomaticKeepAlives: true, + cacheExtent: 1000.0, + addRepaintBoundaries: true, + addSemanticIndexes: true, + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + return CardItemTemplateComponentWidget( + imageHashMap: Map.from({ + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }), + labelsHashMap: Map.from({ + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }), + statusHashMap: [ + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.unknown) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.canceled) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.blocked) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }), + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.inactive) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Inactive', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }), + ], + onTapCardItemAction: () async { + showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return buildDetails( + visitaWrapItem, + context, + changeStatusAction, + ); + }, + ).then((_) { + // PushNotificationManager _pushNotificationService = + // PushNotificationManager(); + // _pushNotificationService.onMessageReceived + // .listen((received) { + // if (received.data['click_action'] == + // 'cancel_request') { + // log('Aprovado'); + // _pushNotificationService.dispose(); + // snackbar(context, opt: true); + // context.pushReplacementNamed( + // 'liberationHistory', + // extra: { + // kTransitionInfoKey: const TransitionInfo( + // hasTransition: true, + // transitionType: PageTransitionType.scale, + // alignment: Alignment.bottomCenter, + // ), + // }, + // ); + // } + // }); + }); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: true, + // isDismissible: true, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model.unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: VisitDetailsModalTemplateComponentWidget( + // visitStatusStr: visitaWrapItem['VAW_STATUS'], + // visitStartDateStr: + // visitaWrapItem['VAW_DTINICIO'], + // visitEndDateStr: visitaWrapItem['VAW_DTFIM'], + // visitReasonStr: + // visitaWrapItem['MOT_DESCRICAO'], + // visitLevelStr: + // visitaWrapItem['NAC_DESCRICAO'], + // visitTempStr: + // visitaWrapItem['VTE_UNICA'].toString(), + // visitObsStr: visitaWrapItem['VAW_OBS'], + // visitorImgPath: valueOrDefault( + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitaWrapItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + // ), + // visitorStrList: + // visitaWrapItem['VTE_DOCUMENTO'], + // visitIdStr: visitaWrapItem['VAW_ID'], + // visitStatusColor: + // visitaWrapItem['VAW_STATUS'] == 'A' + // ? FlutterFlowTheme.of(context).success + // : FlutterFlowTheme.of(context).error, + // visitorJsonList: + // PhpGroup.getVisitsCall.visitasList( + // wrapGetVisitsResponse.jsonBody, + // ), + // updateToggleIdx: () async {}, + // repeatVisitSchedule: () async {}, + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }); + }); + }, ), ); } diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart index c0c3bed8..2adb1620 100644 --- a/lib/pages/visit_history_page/visit_history_page_model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,5 +1,3 @@ - - import 'package:flutter/material.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; @@ -8,11 +6,11 @@ import 'package:hub/flutter_flow/request_manager.dart'; import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; class VisitHistoryPageModel extends FlutterFlowModel { - final _visitHistoryManager = FutureRequestManager(); - Future visitHistory({ + final _visitHistoryManager = StreamRequestManager(); + Stream visitHistory({ String? uniqueQueryKey, bool? overrideCache, - required Future Function() requestFn, + required Stream Function() requestFn, }) => _visitHistoryManager.performRequest( uniqueQueryKey: uniqueQueryKey, @@ -105,4 +103,4 @@ class VisitHistoryPageModel extends FlutterFlowModel { return false; } -} \ No newline at end of file +} diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index 3e813f39..64bfc9c6 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -17,7 +17,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:provider/provider.dart'; - class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ super.key, @@ -233,8 +232,8 @@ Widget visitHistory( ), ], ), - FutureBuilder( - future: _model.visitHistory( + StreamBuilder( + stream: _model.visitHistory( requestFn: () => PhpGroup.getVisitsCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, @@ -586,9 +585,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if (( - jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -614,9 +612,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if ( - jsonToStr( - getJsonField( + } else if (jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -655,9 +652,8 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if (( - jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -754,4 +750,4 @@ Widget visitHistory( ), ), ); -} \ No newline at end of file +} From d36de816f519b884dd0a901e7ae67e1436883847 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:22:09 -0300 Subject: [PATCH 37/72] WIP --- lib/actions/actions.dart | 162 ++-- lib/app_state.dart | 3 - lib/backend/api_requests/api_calls.dart | 49 +- .../pushNotificationService.dart | 74 +- .../tapNotifcationActivity.dart | 89 -- ..._arrow_linked_locals_component_widget.dart | 20 +- .../message_well_component_widget.dart | 11 +- .../schedule_visit_detail_model.dart | 5 - .../card_item_template_component_widget.dart | 8 - .../details_component_action.dart | 47 +- .../details_component_widget.dart | 87 +- ...siter_vistor_template_component_model.dart | 1 - ...iter_vistor_template_component_widget.dart | 2 - .../view_visit_detail_widget.dart | 2 - lib/custom_code/actions/get_dev_u_u_i_d.dart | 31 +- lib/custom_code/widgets/image_cropper.dart | 2 - lib/flutter_flow/flutter_flow_util.dart | 65 ++ lib/flutter_flow/nav/nav.dart | 34 +- lib/flutter_flow/nav/serialization_util.dart | 5 +- lib/main.dart | 1 - .../acess_history_page_widget.dart | 281 +----- lib/pages/home_page/home_page_widget.dart | 6 +- .../liberation_history_widget.dart | 48 +- .../message_history_page_widget.dart | 5 +- .../preferences_settings_model.dart | 3 - .../qr_code_page/qr_code_page_widget.dart | 2 - .../schedule_complete_visit_page_widget.dart | 288 +----- lib/pages/test_page/test_page.dart | 1 - .../visit_history_page_model.dart | 105 --- .../visit_history_page_widget.dart | 850 +++--------------- pubspec.lock | 8 - pubspec.yaml | 1 - 32 files changed, 468 insertions(+), 1828 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 49d9cda7..a153be7c 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -22,7 +22,6 @@ import 'package:url_launcher/url_launcher.dart'; import '../shared/utils/log_util.dart'; Future openTermsOfUse(BuildContext context) async { - log('openTermsOfUse'); final Uri url = Uri.parse('https://freaccess.com.br/pp/'); if (!await launchUrl(url)) { throw Exception('Could not launch $url'); @@ -90,7 +89,6 @@ Future manageStatusColorAction( BuildContext context, { required String? visitStatusStr, }) async { - log('visitStatusStr: $visitStatusStr'); if (visitStatusStr == 'A') { return FlutterFlowTheme.of(context).success; } else if ((visitStatusStr == 'C') || @@ -322,41 +320,28 @@ Future toggleHomePage(BuildContext context) async { ); } -Future visitRequestComponentAction( - BuildContext context, { - required String? actionValue, - required String? refUUID, - required String? responseValue, - required String? vteUUID, -}) async { - ApiCallResponse? respondeSolicitacaoCall; +Future visitCancelAction(BuildContext context, + {required int? idDestino, + required int? idVisita, + required String? accessKey, + required String? email}) async { + ApiCallResponse? apiCallResponse; - respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( + apiCallResponse = await PhpGroup.cancelaVisita.call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'respondeSolicitacao', - referencia: refUUID, - tarefa: actionValue, - resposta: responseValue, - idVisitante: vteUUID, + cliID: FFAppState().cliUUID, + atividade: 'cancelaVisita', + idDestino: idDestino, + idVisita: idVisita, + AccessKey: accessKey, + UsuEmail: email, + DevDesc: '', ); - if (respondeSolicitacaoCall.statusCode == 200) { - log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID; status: ${respondeSolicitacaoCall.jsonBody['error']}'); - return !respondeSolicitacaoCall.jsonBody['error']; + if (apiCallResponse.statusCode == 200) { + return !apiCallResponse.jsonBody['error']; } else { - log('headers: ${respondeSolicitacaoCall.headers}'); - log('bodyText: ${respondeSolicitacaoCall.bodyText}'); - log('jsonBody: ${respondeSolicitacaoCall.jsonBody}'); - log('userUUID: ${FFAppState().userUUID}'); - log('devUUID: ${FFAppState().devUUID}'); - log('cliUUID: ${FFAppState().cliUUID}'); - log('atividade: respondeSolicitacao'); - log('referencia: $refUUID'); - log('tarefa: $actionValue'); - log('resposta: $responseValue'); - log('idVisitante: $vteUUID'); return false; } } @@ -402,7 +387,6 @@ Future checkLocals({ // Verificação rápida de erro para evitar processamento desnecessário. if (response.jsonBody['error']) { - log("checkLocals => Erro encontrado na resposta"); return false; } @@ -414,10 +398,8 @@ Future checkLocals({ // Log e retorno condicional baseado no resultado da busca. if (itemFound) { - log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A"); return true; } else { - log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A"); // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. await showModalBottomSheet( isScrollControlled: true, @@ -440,58 +422,50 @@ Future checkLocals({ } } +Future answersRequest(BuildContext context, String? ref, String? task, + String? response, String? id) async { + ApiCallResponse? respondeSolicitacaoCall; + + respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'respondeSolicitacao', + referencia: ref, + tarefa: task, + resposta: response, + idVisitante: id, + ); + + if (respondeSolicitacaoCall.statusCode == 200) { + return !respondeSolicitacaoCall.jsonBody['error']; + } else { + return false; + } +} + Future changeStatusAction( BuildContext context, - String status, - String vawREF, - String msg, - String vteUUID, + int idDestino, + int idVisita, + String accessKey, + String email, ) async { - log('status: $status'); + Navigator.pop(context, true); - switch (status) { - case 'L': - Navigator.pop(context, true); - - bool? approveVisitRequest; - approveVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (approveVisitRequest == true) { - log('Aprovado'); - context.pop(); - } else { - log('Erro ao aprovar'); - context.pop(); - } - break; - case 'B': - Navigator.pop(context, true); - - bool? blockVisitRequest; - blockVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (blockVisitRequest == true) { - log('Bloqueado'); - return true; - } else { - log('Erro ao bloquear'); - return false; - } - break; - default: - break; + bool? blockVisitRequest; + blockVisitRequest = await visitCancelAction( + context, + accessKey: accessKey, + idDestino: idDestino, + idVisita: idVisita, + email: email, + ); + if (!context.mounted) return; + if (blockVisitRequest == true) { + return true; + } else { + return false; } } @@ -502,8 +476,6 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) { String paddedBadge = identifier.padLeft(30, '0'); - log("Badge: $paddedBadge"); - for (var i = 0; i < paddedBadge.length; i += 2) { packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16)); } @@ -545,8 +517,6 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) { var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); - log("Pacote: $packet"); - log("Bytes: $bytes"); return Uint8List.fromList(packet); } @@ -582,7 +552,6 @@ Widget buildQrCode( required String pass, required int direction}) { try { - log("pass: $pass"); const Color backgroundColor = Colors.white; const Color foregroundColor = Colors.black; return QrImageView.withQr( @@ -784,3 +753,22 @@ Future accessQRCodeOptAction(BuildContext context) async { }, ); } + +enum status { active, unknown, canceled, finished, blocked, inactive } + +status? getStatus(dynamic data) { + switch (data) { + case 'A': + return status.active; + case 'F': + return status.finished; + case 'B': + return status.blocked; + case 'C': + return status.canceled; + case 'I': + return status.inactive; + default: + return status.unknown; + } +} diff --git a/lib/app_state.dart b/lib/app_state.dart index 115951d0..c3a91e95 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -20,7 +20,6 @@ class FFAppState extends ChangeNotifier { return await auth.canCheckBiometrics; } catch (e) { clearBiometricAuthentication(); - debugPrint('Error checking biometrics: $e'); return false; } } @@ -44,8 +43,6 @@ class FFAppState extends ChangeNotifier { // Salvar o estado de autenticação biométrica, se necessário } } catch (e) { - print(e); - debugPrint('Error authenticating: $e'); clearBiometricAuthentication(); return Future.error(e); } diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index d6009dae..1630cdd3 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -47,6 +47,53 @@ class PhpGroup { static ChangePass changePass = ChangePass(); static ChangePanic changePanic = ChangePanic(); static DeleteAccount deleteAccount = DeleteAccount(); + static CancelaVisita cancelaVisita = CancelaVisita(); +} + +class CancelaVisita { + Future call({ + String? devUUID = '', + String? userUUID = '', + String? cliID = '', + String? atividade = '', + int? idDestino, + int? idVisita, + String? AccessKey = '', + String? UsuEmail = '', + String? DevDesc = '', + }) async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'cancelaVisita', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'atividade': atividade, + 'cliID': cliID, + 'idVisita': idVisita, + 'AccessKey': AccessKey, + 'UsuEmail': UsuEmail, + 'DevDesc': DevDesc, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + alwaysAllowBody: false, + ); + } + + bool? error(dynamic response) => castToType(getJsonField( + response, + r'''$.error''', + )); } class DeleteAccount { @@ -2504,7 +2551,6 @@ String _serializeList(List? list) { return json.encode(list, toEncodable: _toEncodable); } catch (_) { if (kDebugMode) { - log("List serialization failed. Returning empty list."); } return '[]'; } @@ -2516,7 +2562,6 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { return json.encode(jsonVar, toEncodable: _toEncodable); } catch (_) { if (kDebugMode) { - log("Json serialization failed. Returning empty json."); } return isList ? '[]' : '{}'; } diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 411682e9..98f023ec 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -59,10 +59,7 @@ class PushNotificationService { sound: true, ); if (settings.authorizationStatus == AuthorizationStatus.authorized) { - log('User granted permission'); - } else { - log('User declined or has not accepted permission'); - } + } else {} } Map validJsonFromString(String? jsonString) { @@ -101,7 +98,6 @@ class PushNotificationService { // Passo 4: Decodificar o JSON corrigido return jsonDecode(correctedJson); } catch (e) { - log('Error decoding JSON: $e'); return {}; } } @@ -126,19 +122,14 @@ class PushNotificationService { _flutterLocalNotificationsPlugin.initialize( initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse response) async { - log('Response payload:${response.payload}'); if (response.payload != null) { try { Map message = validJsonFromString(response.payload!); - log('Notification payload: $message'); var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage - log('Extra: ${data.value}'); _handleNotificationClick(message, extra: data.value); - } catch (e) { - log('Error decoding notification payload: $e'); - } + } catch (e) {} } }, ); @@ -174,8 +165,6 @@ class PushNotificationService { void _listenToForegroundMessages(BuildContext context) { FirebaseMessaging.onMessage.listen((RemoteMessage message) { - log('Got a message whilst in the foreground!'); - log('Message data: ${message.toMap()}'); _onMessage.add(message); _notificationDetails.add(message.toMap()['notification']); _showNotification(message); @@ -188,32 +177,25 @@ class PushNotificationService { void _listenToNotificationClicks(BuildContext context) { FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) { - log('Notification clicked!'); - _onMessage.add(message); - log('Extra: ${message.notification?.body}'); NotificationHandler().handleMessage(message.data, context); }); } void configureTokenRefresh() { - _firebaseMessaging.onTokenRefresh.listen(_handleTokenUpdate).onError((err) { - log("Error refreshing token: $err"); - }); + _firebaseMessaging.onTokenRefresh + .listen(_handleTokenUpdate) + .onError((err) {}); } Future _updateToken(String token) async { FFAppState().token = token; final ApiCallResponse? response = await _updateTokenOnServer(token); if (_isTokenUpdateSuccessful(response)) { - log('Token updated successfully on server. Token: $token'); - } else { - log('Error updating token on server'); - } + } else {} } Future _handleTokenUpdate(String newToken) async { - log('Token refreshed: $newToken'); await _updateToken(newToken); } @@ -226,11 +208,8 @@ class PushNotificationService { final String? deviceToken = await _firebaseMessaging.getToken(); if (deviceToken != null) { - log('Push Messaging token: $deviceToken'); await _updateToken(deviceToken); - } else { - log('Failed to get Firebase Messaging token'); - } + } else {} } Future _requestNotificationPermission() async { @@ -283,7 +262,6 @@ class PushNotificationService { var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails); - log('Showing notification: ${message.messageId.hashCode}'); await _flutterLocalNotificationsPlugin.show( // DateTime.now().millisecondsSinceEpoch % (1 << 31), math.Random().nextInt(1 << 30), @@ -299,32 +277,24 @@ class PushNotificationService { switch (payload.isNotEmpty) { case true: // Print the 'data' property - log('Notification payload: $payload'); - log('Extra: $extra'); // Handle the message data as needed NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra); // Access the 'data' property of 'RemoteMessage' case false: - log('Notification payload is empty'); // Handle the message notification as needed break; } } static Future _firebaseMessagingBackgroundHandler( - RemoteMessage message) async { - log('Handling a background message: ${message.messageId}'); - } + RemoteMessage message) async {} } class NotificationHandler { void handleMessage(Map message, BuildContext context, {Map extra = const {}}) { - log('Notification Received!'); - message.forEach((key, value) { - log('$key: $value'); - }); + message.forEach((key, value) {}); switch (message['click_action']) { case 'visit_request': @@ -340,10 +310,8 @@ class NotificationHandler { _showMessageNotificationDialog(message, context, extra); break; case 'enroll_cond': - log('enroll_cond'); break; default: - log('Notification type not recognized'); } } @@ -363,10 +331,6 @@ class NotificationHandler { void _showAcessNotificationModal( Map message, BuildContext context) { - log('Showing access notification dialog'); - log('USR_TIPO: ${message['USR_TIPO']}'); - log('USR_ID: ${message['USR_ID']}'); - log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}'); showDialog( context: context, builder: (BuildContext context) { @@ -392,8 +356,6 @@ class NotificationHandler { void _showMessageNotificationDialog(Map message, BuildContext context, Map extra) { - log('Showing message notification dialog'); - log('Notification "message": $message'); showDialog( useSafeArea: true, barrierDismissible: true, @@ -432,7 +394,6 @@ class NotificationHandler { void _showVisitRequestDialog( Map message, BuildContext context) { - log('Showing visit request notification dialog'); showDialog( context: context, barrierDismissible: true, @@ -442,13 +403,6 @@ class NotificationHandler { return Dialog( backgroundColor: Colors.transparent, child: VisitRequestTemplateComponentWidget( - vteName: message['mensagem'] ?? 'Unknown', - vteReason: message['motivo'] ?? 'Unknown', - vteMsg: message['mensagem'] ?? 'Unknown', - vteDocument: message['documento'] ?? '', - vteUUID: message['idVisitante'].toString(), - vawRef: message['referencia'].toString(), - vawStatus: 'S', buttons: [ FlutterFlowIconButton( icon: const Icon(Icons.done), @@ -504,10 +458,10 @@ class NotificationHandler { ptText: 'Sim', ), onPressed: () async { - await changeStatusAction.call( + await answersRequest.call( context, - 'L', message['referencia'].toString(), + 'L', 'Mensagem', message['idVisitante'].toString(), ); @@ -588,10 +542,10 @@ class NotificationHandler { ptText: 'Sim', ), onPressed: () async { - await changeStatusAction.call( + await answersRequest.call( context, - 'B', message['referencia'].toString(), + 'B', 'Mensagem', message['idVisitante'].toString(), ); @@ -645,7 +599,7 @@ class NotificationHandler { ): FlutterFlowTheme.of(context).warning, }, ], - changeStatusAction: changeStatusAction, + // changeStatusAction: answersRequest, ), ); }, diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart b/lib/backend/push_notification/tapNotifcationActivity.dart index 1ee22050..8b137891 100644 --- a/lib/backend/push_notification/tapNotifcationActivity.dart +++ b/lib/backend/push_notification/tapNotifcationActivity.dart @@ -1,90 +1 @@ -// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; -// import 'package:firebase_messaging/firebase_messaging.dart'; -// import 'package:flutter/material.dart'; -// import 'package:rxdart/rxdart.dart'; - - - -// class NotificationHandler { -// // Criar BehaviorSubjects para mensagens em primeiro plano e mensagens que abriram o app -// final BehaviorSubject _onMessage = -// BehaviorSubject(); -// final BehaviorSubject _onMessageOpenedApp = -// BehaviorSubject(); - -// // Inicializar listeners no construtor -// NotificationHandler() { -// initializeListeners(); -// } - -// void initializeListeners() async { -// // Listener para mensagens em primeiro plano -// // FirebaseMessaging.onMessage.listen((message) { -// // _onMessage.add(message); // Adicionar mensagem ao stream -// // }); - -// RemoteMessage? initialMessage = -// await FirebaseMessaging.instance.getInitialMessage(); - -// if (initialMessage != null) _onMessage.add(initialMessage); - -// // Listener para mensagens que abriram o app -// FirebaseMessaging.onMessageOpenedApp.listen((message) { -// _onMessageOpenedApp.add(message); // Adicionar mensagem ao stream -// }); -// } - -// void openedAppVisitRequestNotification( -// RemoteMessage message, BuildContext context) { -// log('openedAppVisitRequestNotification'); -// showDialog( -// context: context, -// builder: (BuildContext context) { -// return Dialog( -// backgroundColor: -// Colors.transparent, // Faz o fundo do Dialog ser transparente -// child: VisitRequestTemplateComponentWidget( -// name: message.data['nome'] ?? 'blabla', -// reason: message.data['motivo'] ?? 'blabla', -// message: message.data['mensagem'] ?? 'blabla', -// document: message.data['document']), -// ); -// }); -// } - -// // Método para tratar mensagens recebidas -// void handleMessage(RemoteMessage message, BuildContext context) { -// log('Notification Received!'); -// message.data.forEach((key, value) { -// log('$key: $value'); -// }); - -// switch (message.data['type']) { -// case 'visit_request': -// openedAppVisitRequestNotification(message, context); -// break; -// case '': -// break; -// default: -// log('Notification type not recognized'); -// } -// } - -// // Ouvir streams -// void listenToNotifications(BuildContext context) { -// _onMessage.listen((message) { -// handleMessage(message, context); -// }); - -// _onMessageOpenedApp.listen((message) { -// handleMessage(message, context); -// }); -// } - -// // Dispor streams -// void dispose() { -// _onMessage.close(); -// _onMessageOpenedApp.close(); -// } -// } diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index b1ece369..c2bc0753 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -10,7 +10,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; - class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); @@ -100,9 +99,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState color: FlutterFlowTheme.of(context).primary, size: 24.0, ), - onPressed: () { - print('IconButton pressed ...'); - }, + onPressed: () {}, ), ), Expanded( @@ -180,8 +177,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState width: 50.0, height: double.infinity, decoration: const BoxDecoration(), - alignment: - const AlignmentDirectional(0.0, 0.0), + alignment: const AlignmentDirectional( + 0.0, 0.0), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: @@ -232,14 +229,15 @@ class _BottomArrowLinkedLocalsComponentWidgetState width: double.infinity, height: double.infinity, fit: BoxFit.fill, - alignment: - const Alignment(0.0, 0.0), + alignment: const Alignment( + 0.0, 0.0), ), ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 10.0, 0.0, 0.0), child: Text( getJsonField( @@ -290,4 +288,4 @@ class _BottomArrowLinkedLocalsComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart index fb4632a9..f56b8c36 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -213,7 +212,7 @@ class _MessageWellComponentWidgetState children: [ Icon( message['MSG_DESTINO_TP'] == 'T' - ? EvaIcons.globe + ? Icons.language : message['MSG_DESTINO_TP'] == 'P' ? Icons.person : Icons.home, @@ -374,12 +373,8 @@ class MessageWellNotifier extends StateNotifier { // .toList(); // Provider.of(context, listen: false).setCounter(int.parse(response.jsonBody['total_pages'])); // totalPageNumber = int.parse(response.jsonBody['total_pages']); - } else { - log('Error fetching messages: ${response.statusCode}'); - } - } else { - log('No more messages to fetch ...'); - } + } else {} + } else {} } List getMessages() { diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index d4df4084..9abfbefe 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -40,8 +40,6 @@ class ScheduleVisitDetailModel String convertDateFormat(String dateStr) { try { - log('Received date string: $dateStr'); - // Formato original DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); // Novo formato @@ -50,7 +48,6 @@ class ScheduleVisitDetailModel // Validate the input string format if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') .hasMatch(dateStr)) { - log('Invalid date format: $dateStr'); return 'Invalid date format'; } @@ -59,11 +56,9 @@ class ScheduleVisitDetailModel // Converte DateTime para a nova string formatada String formattedDate = newFormat.format(dateTime); - log('Formatted date: $formattedDate'); return formattedDate; } catch (e) { // Handle the exception by returning an error message or a default value - log('Error parsing date: $e'); return 'Invalid date format'; } } diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index fd8b4c48..1b503c1e 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -74,14 +74,6 @@ class _CardItemTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - log('------------------------------'); - log('labelsHashMap: ${widget.labelsHashMap}'); - log('statusHashMap: ${widget.statusHashMap}'); - log('imageHashMap: ${widget.imageHashMap}'); - log('onTapCardItemAction: ${widget.onTapCardItemAction}'); - log('labelsLinkedHashMap: $labelsLinkedHashMap'); - log('statusLinkedHashMap: $statusLinkedHashMap'); - log('------------------------------'); return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index bf7df5fe..fafb0916 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; +import 'package:hub/actions/actions.dart'; import 'package:hub/app_state.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; @@ -12,45 +13,12 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; -enum status { active, unknown, canceled, finished, blocked, inactive } - -status? getStatus(dynamic data) { - debugPrint('getStatus: $data'); - switch (data) { - case 'A': - return status.active; - case 'F': - return status.finished; - case 'B': - return status.blocked; - case 'C': - return status.canceled; - case 'I': - return status.inactive; - default: - return status.unknown; - } -} - Widget buildDetails( dynamic visitaWrapItem, BuildContext context, - Future Function(BuildContext, String, String, String, String)? + Future Function(BuildContext, int, int, String, String)? changeStatusAction) { return VisitRequestTemplateComponentWidget( - vteName: 'Lorem Ipsus', - vteReason: 'Lorem Ipsus', - vawDate: 'Lorem Ipsus', - vawStatus: 'Lorem Ipsus', - vteMsg: 'Lorem Ipsus', - vteUUID: 'Lorem Ipsus', - cliUUID: FFAppState().cliUUID, - msgUUID: 'Lorem Ipsus', - vawDestino: 'Lorem Ipsus', - vawUUID: 'Lorem Ipsus', - vawName: 'Lorem Ipsus', - vawRef: 'Lorem Ipsus', - changeStatusAction: changeStatusAction, buttons: [ if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // REJECT ACTION @@ -109,13 +77,14 @@ Widget buildDetails( await changeStatusAction ?.call( context, - 'B', - visitaWrapItem['VAW_REF'] ?? '', - 'Mensagem', - visitaWrapItem['VTE_ID'] ?? '', + int.parse(visitaWrapItem['VAW_DESTINO']), + int.parse(visitaWrapItem['VAW_ID']), + visitaWrapItem['VAW_CHAVE'] ?? '', + visitaWrapItem['VTE_DOCUMENTO'] ?? '', ) .then((value) { Navigator.pop(context); + Navigator.pop(context); if (value == false) { showSnackbar( context, @@ -136,8 +105,6 @@ Widget buildDetails( ); } }).catchError((err, stack) { - debugPrint('Error: $err'); - debugPrint('Stack: $stack'); showSnackbar( context, FFLocalizations.of(context).getVariableText( diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index f6576993..bc8e40f1 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -14,20 +14,6 @@ import 'package:provider/provider.dart'; class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ Key? key, - required this.vteName, - required this.vteReason, - required this.vteMsg, - this.vteDocument, - this.cliUUID, - this.vteUUID, - this.vawName, - this.msgUUID, - this.vawRef, - this.vawUUID, - this.vawDestino, - required this.vawStatus, - this.vawDate, - this.changeStatusAction, required this.labelsHashMap, required this.statusHashMap, required this.imageHashMap, @@ -41,27 +27,12 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget { final Future Function()? onTapCardItemAction; final List buttons; - final String? vteName; - final String? vteReason; - final String? vteMsg; - final String? vteDocument; - final String? cliUUID; - final String? vteUUID; - final String? vawName; - final String? msgUUID; - final String? vawRef; - final String? vawUUID; - final String? vawDestino; - final String? vawStatus; - final String? vawDate; - - final Future Function( - BuildContext context, - String status, - String vawREF, - String msg, - String vteUUID, - )? changeStatusAction; + // final Future Function( + // BuildContext context, + // int idDestino, + // int idVisita, + // String AccessKey, + // )? changeStatusAction; @override State createState() => @@ -90,24 +61,6 @@ class _VisitRequestTemplateComponentWidgetState void initState() { super.initState(); _model = createModel(context, () => VisitRequestTemplateComponentModel()); - - _model.textController1 ??= TextEditingController(text: widget.vteName); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(text: widget.vteReason); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(text: widget.vteMsg); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(text: widget.vawDate); - _model.textFieldFocusNode4 ??= FocusNode(); - - _model.textController5 ??= TextEditingController(); - _model.textFieldFocusNode5 ??= FocusNode(); - - _model.textControllerStatus ??= - TextEditingController(text: widget.vawStatus); _model.textFieldFocusNodeStatus ??= FocusNode(); } @@ -120,21 +73,21 @@ class _VisitRequestTemplateComponentWidgetState @override Widget build(BuildContext context) { - log('VAW_STATUS: ${statusLinkedHashMap}'); context.watch(); - bool isLoaded = false; - final pending = FFLocalizations.of(context).getVariableText( - enText: 'Pending', - ptText: 'Pendente', - ); - final active = FFLocalizations.of(context).getVariableText( - enText: 'Ativo', - ptText: 'Ativo', - ); - final canceled = FFLocalizations.of(context).getVariableText( - enText: 'Canceled', - ptText: 'Cancelado', - ); + + // bool isLoaded = false; + // final pending = FFLocalizations.of(context).getVariableText( + // enText: 'Pending', + // ptText: 'Pendente', + // ); + // final active = FFLocalizations.of(context).getVariableText( + // enText: 'Ativo', + // ptText: 'Ativo', + // ); + // final canceled = FFLocalizations.of(context).getVariableText( + // enText: 'Canceled', + // ptText: 'Cancelado', + // ); return LayoutBuilder( builder: (context, constraints) { diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index 192f8fc3..3c65d365 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -45,7 +45,6 @@ class RegisiterVistorTemplateComponentModel documento: document, ); - log('${response.jsonBody}'); if (response.jsonBody['visitante']['VTE_ID'] != '0' && response.jsonBody['error'] != 'false') { return true; diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index f1cc977d..adaec865 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -69,7 +69,6 @@ class _RegisiterVistorTemplateComponentWidgetState } void _onTextChanged() { - log('changed'); setState(() {}); } @@ -94,7 +93,6 @@ class _RegisiterVistorTemplateComponentWidgetState return false; } - log("Visitante Já Cadastrado $_isVisitorRegistered"); if (_isVisitorRegistered) { return false; } diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index 949290cb..647a9541 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -63,7 +63,6 @@ List? findVisitorById(List? jsonList, String? id) { ); return foundItem != null ? [foundItem] : null; } catch (e) { - log("Error searching item: $e"); return null; } } @@ -874,7 +873,6 @@ class _ViewVisitDetailWidgetState extends State { size: 24.0, ), onPressed: () { - log('IconButton pressed ...'); // Implement share functionality here Share.share( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart index e5df025d..3e70fa5d 100644 --- a/lib/custom_code/actions/get_dev_u_u_i_d.dart +++ b/lib/custom_code/actions/get_dev_u_u_i_d.dart @@ -1,5 +1,3 @@ - - import '/backend/schema/structs/index.dart'; import 'dart:developer'; import '/backend/schema/enums/enums.dart'; @@ -12,29 +10,14 @@ import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; - - - Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { // import 'dart:io' var iosDeviceInfo = await deviceInfo.iosInfo; - log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1" - log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS" - log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3" - log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone" - log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone" - log('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E" return iosDeviceInfo.identifierForVendor; // unique ID on iOS } else if (Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; - // log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E" - log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.id; // unique ID on Android } } @@ -44,21 +27,9 @@ Future getSerialNumber() async { if (Platform.isIOS) { // import 'dart:io' var iosDeviceInfo = await deviceInfo.iosInfo; - log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1" - log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS" - log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3" - log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone" - log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone" - log('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E" return iosDeviceInfo.identifierForVendor; // unique ID on iOS } else if (Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; - // log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E" - log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone" - log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.serialNumber; // unique ID on Android + } } -} \ No newline at end of file diff --git a/lib/custom_code/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart index 90704f46..9b79b434 100644 --- a/lib/custom_code/widgets/image_cropper.dart +++ b/lib/custom_code/widgets/image_cropper.dart @@ -60,7 +60,6 @@ // final path = _getStoragePath(_firebasePathPrefix(), // widget.imageFile!.name!, false, 0); // uploadData(path, image).then((value) { -// log('image cropped'); // widget.callBackAction!.call(value!); // loading = false; // }); @@ -95,7 +94,6 @@ // setState(() { // loading = true; // }); -// log('Button pressed ...'); // _crop_controller.crop(); // //widget.loading = true; diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index b2c3e3fb..78192536 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -6,6 +6,8 @@ import 'package:flutter/services.dart'; import 'package:collection/collection.dart'; import 'package:from_css_color/from_css_color.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'dart:math' show pow, pi, sin; import 'package:intl/intl.dart'; import 'package:json_path/json_path.dart'; @@ -547,6 +549,69 @@ void showSnackbar( ); } +void showAlertDialog( + BuildContext context, String title, String content, Future action) { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + title: Text(title), + content: Text(content), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () => Navigator.pop(context), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'No', + ptText: 'Não', + ), + ), + FFButtonWidget( + onPressed: () async { + await action; + }, + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.05, + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + text: FFLocalizations.of(context).getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + ), + ], + ), + ], + ); + }); +} + extension FFStringExt on String { String maybeHandleOverflow({int? maxChars, String replacement = ''}) => maxChars != null && length > maxChars diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 86f9ca21..68bfc993 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -76,19 +76,18 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => params.isEmpty - ? const HomePageWidget() - : const HomePageWidget(), + builder: (context, params) => + params.isEmpty ? const HomePageWidget() : const HomePageWidget(), ), + // FFRoute( + // name: 'visitHistoryPage', + // path: '/visitHistoryPage', + // builder: (context, params) => const VisitHistoryPageWidget(), + // ), FFRoute( - name: 'visitHistoryPage', - path: '/visitHistoryPage', - builder: (context, params) => const VisitHistoryPageWidget(), - ), - FFRoute( - name: 'messageHistoryPage', - path: '/messageHistoryPage', - builder: (context, params) => const MessageHistoryPageWidget()), + name: 'messageHistoryPage', + path: '/messageHistoryPage', + builder: (context, params) => const MessageHistoryPageWidget()), FFRoute( name: 'registerVisitorPage', path: '/registerVisitorPage', @@ -99,7 +98,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( path: '/scheduleCompleteVisitPage', builder: (context, params) => ScheduleCompleteVisitPageWidget( // get current datatime picker dd/mm/aaaa hh:mm:ss - // visitStartDateStr: DateTime.now().toString(), + // visitStartDateStr: DateTime.now().toString(), // post 1 day // visitEndDateStr: DateTime.now().add(const Duration(days: 1)).toString(), visitorStrList: params.getParam( @@ -148,9 +147,12 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( path: '/fastPassPage', builder: (context, params) => /*const*/ FastPassPageWidget(), ), - FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => const PreferencesPageWidget( - key: Key('preferencesSettings'), - )), + FFRoute( + name: 'preferencesSettings', + path: '/preferencesSettings', + builder: (context, params) => const PreferencesPageWidget( + key: Key('preferencesSettings'), + )), FFRoute( name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', @@ -397,4 +399,4 @@ extension GoRouterLocationExtension on GoRouter { : routerDelegate.currentConfiguration; return matchList.uri.toString(); } -} \ No newline at end of file +} diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart index 887c8eec..349feee6 100644 --- a/lib/flutter_flow/nav/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -10,7 +10,6 @@ import '../../flutter_flow/lat_lng.dart'; import '../../flutter_flow/place.dart'; import '../../flutter_flow/uploaded_file.dart'; - /// SERIALIZATION HELPERS String dateTimeRangeToString(DateTimeRange dateTimeRange) { @@ -85,7 +84,6 @@ String? serializeParam( } return data; } catch (e) { - log('Error serializing parameter: $e'); return null; } } @@ -226,7 +224,6 @@ dynamic deserializeParam( return null; } } catch (e) { - log('Error deserializing parameter: $e'); return null; } -} \ No newline at end of file +} diff --git a/lib/main.dart b/lib/main.dart index 642f9e0b..61119468 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,7 +30,6 @@ void main() async { Future initializeApp() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; - await FlutterFlowTheme.initialize(); await FFLocalizations.initialize(); final appState = FFAppState(); diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index 58976eb6..48a4ae87 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -19,9 +19,6 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; - - - @immutable class AcessHistoryPageWidget extends StatefulWidget { late Map opt = { @@ -58,16 +55,13 @@ class _AcessHistoryPageWidgetState extends State { _AcessHistoryPageWidgetState(Map opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { - selectedTypeSubject.listen((value) { - log("selectedTypeSubject changed: $value"); - }); + selectedTypeSubject.listen((value) {}); } @override void initState() { super.initState(); _model = createModel(context, () => AcessHistoryPageModel()); - log("initState called in _AcessHistoryPageWidgetState"); } @override @@ -134,7 +128,6 @@ class _AcessHistoryPageWidgetState extends State { } Widget _appBarFilterButtonAtomWidget(BuildContext context) { - log('selectedTypeSubject: ${selectedTypeSubject.value}'); return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -156,7 +149,6 @@ class _AcessHistoryPageWidgetState extends State { ); if (selectedFilter != null) { - log('Selected Filter: $selectedFilter'); _updateAccessHistoryAction(selectedFilter); } }, @@ -178,14 +170,12 @@ class _AcessHistoryPageWidgetState extends State { }); if (needsUpdate) { selectedTypeSubject.add(updatedType); - log("updateAccessHistory called with newType: $newType"); safeSetState(() {}); } } } Stream fetchAccessHistoryService(String selectedType) { - log('Calling API with type: $selectedType'); switch (selectedType) { case 'E': return _model.accessHistory( @@ -247,14 +237,9 @@ class _AcessHistoryPageWidgetState extends State { Future> fetchCardListViewService( Map select) async { - log('Fetching access history'); final response = await fetchAccessHistoryService(select['personType']!).first; - log('Response: ${response.jsonBody}'); final List accessHistory = response.jsonBody['acessos'] ?? []; - log('Access History Before Filtering: $accessHistory'); - log( - 'Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}'); return accessHistory.where((item) { final personTypeMatches = select['personType'] == '.*' || @@ -266,20 +251,15 @@ class _AcessHistoryPageWidgetState extends State { .toString() .toLowerCase() .contains(select['search']!.toLowerCase()); - log('NOMES: ${item["PES_NOME"].toString().toLowerCase()}'); return personTypeMatches && accessTypeMatches && searchMatches; }).toList(); } Widget _cardListViewOrganismWidget(Map selected) { - log( - 'Selected types in Card: ${selected['personType']}, ${selected['accessType']}'); - log('_buildAccessHistoryList called'); return FutureBuilder>( future: fetchCardListViewService(selected), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - log('Waiting for data'); return Center( child: SizedBox( width: 50.0, @@ -294,15 +274,12 @@ class _AcessHistoryPageWidgetState extends State { return Text('Error: ${snapshot.error}'); } else { final accessHistory = snapshot.data!; - log('Access History: $accessHistory'); return ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemCount: accessHistory.length, itemBuilder: (context, index) { final accessHistoryItem = accessHistory[index]; - log( - 'Access History Item: ${accessHistoryItem['PES_TIPO']}'); return _accessHistoryCardMoleculeWidget( context, accessHistoryItem); }, @@ -314,7 +291,6 @@ class _AcessHistoryPageWidgetState extends State { Widget _accessHistoryCardMoleculeWidget( BuildContext context, dynamic accessHistoryItem) { - log('Access History Item: $accessHistoryItem'); return CardItemTemplateComponentWidget( imageHashMap: Map.from({ 'key': accessHistoryItem['PES_ID'] ?? '', @@ -327,230 +303,53 @@ class _AcessHistoryPageWidgetState extends State { }), statusHashMap: [ accessHistoryItem['PES_TIPO'] == 'O' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Morador', - enText: 'Resident', - ): FlutterFlowTheme.of(context).alternate2, - }) - : accessHistoryItem['PES_TIPO'] == 'E' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Visitante', - enText: 'Visitor', - ): FlutterFlowTheme.of(context).alternate2, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate2, - }), + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, + }) + : accessHistoryItem['PES_TIPO'] == 'E' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Visitante', + enText: 'Visitor', + ): FlutterFlowTheme.of(context).alternate2, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate2, + }), accessHistoryItem['ACE_TIPO'] == '0' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Entrada', - enText: 'Entrance', - ): FlutterFlowTheme.of(context).success, - }) - : accessHistoryItem['ACE_TIPO'] == '1' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Saída', - enText: 'Exit', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).warning, - }) + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Entrada', + enText: 'Entrance', + ): FlutterFlowTheme.of(context).success, + }) + : accessHistoryItem['ACE_TIPO'] == '1' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Saída', + enText: 'Exit', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).warning, + }) ], onTapCardItemAction: () async {}); } } -Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, - String tipoPessoa, Color corFundoTipo, accessHistoryItem) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - urlImagem, - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - getJsonField( - accessHistoryItem, - r'''$.PES_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Container( - width: 100.0, - height: 25.0, - decoration: BoxDecoration( - color: (() { - // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = - jsonToStr(getJsonField( - accessHistoryItem, - r'''$.PES_TIPO''', - )) - .trim() - .replaceAll('"', ''); // Remove aspas - - // Debug: Imprime o valor de PES_TIPO ajustado - log('PES_TIPO FOR COLORING: $pesTipo'); - - // Retorna a cor baseada na condição ajustada - return pesTipo == 'E' - ? FlutterFlowTheme.of(context).warning - : FlutterFlowTheme.of(context).primary; - })(), - borderRadius: BorderRadius.circular(24.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - getJsonField( - accessHistoryItem, - r'''$.PES_TIPO''', - ).toString() == - 'E' - ? FFLocalizations.of(context).getText( - 'zok7lu4w', - ) - : FFLocalizations.of(context).getText( - 'oonqk812', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 5.0)) - .addToEnd(const SizedBox(width: 5.0)), - ); -} - -Widget _cardDetailsMoleculeWidget( - BuildContext context, dynamic accessHistoryItem) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - '2odgr6hg', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Text( - getJsonField( - accessHistoryItem, - r'''$.ACE_DATAHORA''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ].addToStart(const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - 'zrde3fke', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Text( - getJsonField( - accessHistoryItem, - r'''$.ACI_DESCRICAO''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ].addToStart(const SizedBox(width: 10.0)), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ] - .addToStart(const SizedBox(width: 5.0)) - .addToEnd(const SizedBox(width: 5.0)), - ); -} - String imageUrlAtomWidget(String document, String type) { return valueOrDefault( "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} \ No newline at end of file +} diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 6cf9f539..ee4abbe3 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -298,9 +298,7 @@ class _HomePageWidgetState extends State { color: FlutterFlowTheme.of(context).info, size: 24.0, ), - onPressed: () { - log('IconButton pressed ...'); - }, + onPressed: () {}, ), ), ), @@ -545,7 +543,7 @@ class _HomePageWidgetState extends State { ), FFButtonWidget( onPressed: () async { - FFAppState().isLogged = false; + FFAppState().deleteAll(); setState(() {}); context.goNamed( diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index c13695f9..ef9bed94 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -330,7 +330,6 @@ Widget liberationHistoryItemCard( }) ], onTapCardItemAction: () async { - log('LiberationItem: $liberationHistoryItem'); showModalBottomSheet( isScrollControlled: true, isDismissible: true, @@ -339,20 +338,20 @@ Widget liberationHistoryItemCard( context: context, builder: (context) { return VisitRequestTemplateComponentWidget( - vteName: liberationHistoryItem['VTE_NOME'], - vteReason: liberationHistoryItem['NOT_MOTIVO'], - vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - ? liberationHistoryItem['NOT_DTENVIO'] - : liberationHistoryItem['NOT_DTRESPOSTA'], - vawStatus: liberationHistoryItem['NOT_STATUS'], - vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - vteUUID: liberationHistoryItem['VTE_ID'], - cliUUID: FFAppState().cliUUID, - msgUUID: liberationHistoryItem['NOT_ID'], - vawDestino: liberationHistoryItem['NOT_DESTINO'], - vawUUID: liberationHistoryItem['NOT_ID'], - vawName: liberationHistoryItem['NOT_NOME'], - vawRef: liberationHistoryItem['NOT_ID'], + // vteName: liberationHistoryItem['VTE_NOME'], + // vteReason: liberationHistoryItem['NOT_MOTIVO'], + // vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' + // ? liberationHistoryItem['NOT_DTENVIO'] + // : liberationHistoryItem['NOT_DTRESPOSTA'], + // vawStatus: liberationHistoryItem['NOT_STATUS'], + // vteMsg: liberationHistoryItem['NOT_MSGENVIO'], + // vteUUID: liberationHistoryItem['VTE_ID'], + // cliUUID: FFAppState().cliUUID, + // msgUUID: liberationHistoryItem['NOT_ID'], + // vawDestino: liberationHistoryItem['NOT_DESTINO'], + // vawUUID: liberationHistoryItem['NOT_ID'], + // vawName: liberationHistoryItem['NOT_NOME'], + // vawRef: liberationHistoryItem['NOT_ID'], labelsHashMap: Map.from({ 'Nome:': liberationHistoryItem['VTE_NOME'], 'Data:': liberationHistoryItem['NOT_DTENVIO'], @@ -418,13 +417,19 @@ Widget liberationHistoryItemCard( ptText: 'Sim', ), onPressed: () async { - await changeStatusAction.call( + Navigator.pop(context); + Navigator.pop(context); + await answersRequest + .call( context, - 'L', liberationHistoryItem['NOT_ID'].toString(), + 'L', 'Mensagem', liberationHistoryItem['VTE_ID'].toString(), - ); + ) + .then((value) { + log(value.toString()); + }); }, options: FFButtonOptions( width: 100, @@ -505,10 +510,10 @@ Widget liberationHistoryItemCard( ptText: 'Sim', ), onPressed: () async { - await changeStatusAction.call( + await answersRequest.call( context, - 'B', liberationHistoryItem['NOT_ID'].toString(), + 'B', 'Mensagem', liberationHistoryItem['VTE_ID'].toString(), ); @@ -562,7 +567,7 @@ Widget liberationHistoryItemCard( 'key': liberationHistoryItem['VTE_ID'], 'value': 'E', }), - changeStatusAction: changeStatusAction, + // changeStatusAction: answersRequest, // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], ); }, @@ -572,7 +577,6 @@ Widget liberationHistoryItemCard( _pushNotificationService.onMessageReceived.listen((received) { if (received.data['click_action'] == 'cancel_request') { - log('Aprovado'); _pushNotificationService.dispose(); snackbar(context, opt: true); context.pushReplacementNamed( diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index df268d4d..7c6d07dd 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,7 +2,6 @@ import 'dart:developer'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; @@ -219,8 +218,6 @@ Widget buildListView( snapshot.data == null || !snapshot.hasData || snapshot.hasError) { - log('Error: ${snapshot.error.toString()}'); - // log('Error: ${snapshot.data!.jsonBody['mensagens']}'); return const Center( child: Text('Erro ao carregar mensagens'), ); @@ -273,7 +270,7 @@ Widget buildListItem(BuildContext context, dynamic jsonBody) { children: [ Icon( jsonBody['MSG_DESTINO_TP'] == 'T' - ? EvaIcons.globe + ? Icons.language : jsonBody['MSG_DESTINO_TP'] == 'P' ? Icons.person : Icons.home, diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 1a3ff528..7ed3cef2 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -520,7 +520,6 @@ class PreferencesPageModel with ChangeNotifier { } Future togglePass(BuildContext context) async { - debugPrint('pass: ${FFAppState().pass}'); // if (FFAppState().pass) { // FFAppState().pass = false; // FFAppState().deleteAccessPass(); @@ -538,7 +537,6 @@ class PreferencesPageModel with ChangeNotifier { toggleActionStatus: (key) async { FFAppState().accessPass = key; notifyListeners(); - debugPrint('key: $key'); await PhpGroup.changePass .call( userUUID: FFAppState().userUUID, @@ -549,7 +547,6 @@ class PreferencesPageModel with ChangeNotifier { ) .then((value) { // var error = jsonDecode(value.jsonBody['error'].toString()); - // log('${jsonDecode(value.jsonBody['error'].toString())}'); if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; ScaffoldMessenger.of(context).showSnackBar( diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index 7ddd315d..09e790d5 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -398,7 +398,6 @@ class _QrCodePageWidgetState extends State padding: MediaQuery.viewInsetsOf(context), child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { - log('Key: $key'); safeSetState(() { if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { @@ -418,7 +417,6 @@ class _QrCodePageWidgetState extends State ); }, ).catchError((error) => safeSetState(() { - log('Error: $error'); _resetAnimationAndToggleAccess(); })); unawaited( diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 79647877..0ca53309 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -22,6 +22,7 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; +import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; import 'package:provider/provider.dart'; class ScheduleCompleteVisitPageWidget extends StatefulWidget { @@ -162,26 +163,6 @@ class _ScheduleCompleteVisitPageWidgetState } } -enum status { active, unknown, canceled, finished, blocked, inactive } - -status? getStatus(dynamic data) { - debugPrint('getStatus: $data'); - switch (data) { - case 'A': - return status.active; - case 'F': - return status.finished; - case 'B': - return status.blocked; - case 'C': - return status.canceled; - case 'I': - return status.inactive; - default: - return status.unknown; - } -} - PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -267,7 +248,16 @@ Widget bodyScheduleCompleteVisit( controller: _model.tabBarController, children: [ scheduleVisit(context, _model, setState, safeSetState), - visitHistory(context, _model, safeSetState), + wrapWithModel( + model: _model, + child: VisitHistoryWidget( + model: _model, + safeSetState: safeSetState, + ), + updateCallback: () { + setState(() {}); + }, + updateOnChange: true), ], ), ), @@ -863,40 +853,8 @@ Widget scheduleVisit( focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: () async { - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - // context: context, - // builder: (context) { - // return GestureDetector( - // onTap: () => _model - // .unfocusNode.canRequestFocus - // ? FocusScope.of(context) - // .requestFocus(_model.unfocusNode) - // : FocusScope.of(context).unfocus(), - // child: Padding( - // padding: - // MediaQuery.viewInsetsOf(context), - // child: - // const VisitorDetailsModalTemplateComponentWidget( - // visitorImageURL: '', - // visitorEmail: '', - // visitorName: '', - // visitorPhone: '', - // visitorType: '', - // ), - // ), - // ); - // }, - // ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - // _model.removeFromVisitorJsonList( - // visitorListViewItem); - // setState(() {}); - }, + onTap: () async {}, + onLongPress: () async {}, child: Container( width: MediaQuery.of(context).size.width, height: 70.0, @@ -1460,16 +1418,6 @@ Widget scheduleVisit( ), hoverColor: FlutterFlowTheme.of(context).primaryBackground, - // thumbColor: WidgetStateColor.resolveWith( - // (states) { - // if (states.contains(WidgetState.disabled)) { - // return FlutterFlowTheme.of(context) - // .alternate; - // } - // return FlutterFlowTheme.of(context) - // .alternate; - // }, - // ), overlayColor: WidgetStateProperty.resolveWith( (states) { if (states.contains(WidgetState.disabled)) { @@ -1684,213 +1632,3 @@ Widget scheduleVisit( ), ); } - -Widget visitHistory( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function safeSetState, -) { - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: StreamBuilder( - stream: _model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - pageSize: 100, - pageNumber: 1, - ), - ), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, - ), - )); - } else if (snapshot.hasError) { - log('Error: ${snapshot.error}'); - return Center(child: Text('Error: ${snapshot.error}')); - } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { - log('No data or jsonBody is null'); - return const Center(child: Text('No visits found')); - } - - final wrapGetVisitsResponse = snapshot.data!; - log('Response: ${wrapGetVisitsResponse.jsonBody}'); - - final visitaWrap = PhpGroup.getVisitsCall - .visitasList(wrapGetVisitsResponse.jsonBody) - ?.toList() ?? - []; - log('visitaWrap: $visitaWrap'); - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }), - labelsHashMap: Map.from({ - 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', - 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', - 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', - }), - statusHashMap: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.active) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).warning, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Finalizado', - enText: 'Finished', - ): FlutterFlowTheme.of(context).success, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.unknown) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.canceled) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.blocked) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }), - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.inactive) - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Inactive', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).error, - }), - ], - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return buildDetails( - visitaWrapItem, - context, - changeStatusAction, - ); - }, - ).then((_) { - // PushNotificationManager _pushNotificationService = - // PushNotificationManager(); - // _pushNotificationService.onMessageReceived - // .listen((received) { - // if (received.data['click_action'] == - // 'cancel_request') { - // log('Aprovado'); - // _pushNotificationService.dispose(); - // snackbar(context, opt: true); - // context.pushReplacementNamed( - // 'liberationHistory', - // extra: { - // kTransitionInfoKey: const TransitionInfo( - // hasTransition: true, - // transitionType: PageTransitionType.scale, - // alignment: Alignment.bottomCenter, - // ), - // }, - // ); - // } - // }); - }); - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: true, - // isDismissible: true, - // useSafeArea: true, - // context: context, - // builder: (context) { - // return GestureDetector( - // onTap: () => _model.unfocusNode.canRequestFocus - // ? FocusScope.of(context) - // .requestFocus(_model.unfocusNode) - // : FocusScope.of(context).unfocus(), - // child: VisitDetailsModalTemplateComponentWidget( - // visitStatusStr: visitaWrapItem['VAW_STATUS'], - // visitStartDateStr: - // visitaWrapItem['VAW_DTINICIO'], - // visitEndDateStr: visitaWrapItem['VAW_DTFIM'], - // visitReasonStr: - // visitaWrapItem['MOT_DESCRICAO'], - // visitLevelStr: - // visitaWrapItem['NAC_DESCRICAO'], - // visitTempStr: - // visitaWrapItem['VTE_UNICA'].toString(), - // visitObsStr: visitaWrapItem['VAW_OBS'], - // visitorImgPath: valueOrDefault( - // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - // visitaWrapItem, - // r'''$.VTE_DOCUMENTO''', - // ).toString()}&tipo=E", - // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - // ), - // visitorStrList: - // visitaWrapItem['VTE_DOCUMENTO'], - // visitIdStr: visitaWrapItem['VAW_ID'], - // visitStatusColor: - // visitaWrapItem['VAW_STATUS'] == 'A' - // ? FlutterFlowTheme.of(context).success - // : FlutterFlowTheme.of(context).error, - // visitorJsonList: - // PhpGroup.getVisitsCall.visitasList( - // wrapGetVisitsResponse.jsonBody, - // ), - // updateToggleIdx: () async {}, - // repeatVisitSchedule: () async {}, - // ), - // ); - // }, - // ).then((value) => safeSetState(() {})); - }); - }); - }, - ), - ); -} diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart index c8e9cc15..b7a0e8db 100644 --- a/lib/pages/test_page/test_page.dart +++ b/lib/pages/test_page/test_page.dart @@ -53,7 +53,6 @@ // imageHashMap: imageKeyValue, // onTapCardItemAction: () async { // // Ação ao tocar no card -// log('Card tapped'); // }, // ); // }), diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart index 2adb1620..8b137891 100644 --- a/lib/pages/visit_history_page/visit_history_page_model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,106 +1 @@ -import 'package:flutter/material.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/form_field_controller.dart'; -import 'package:hub/flutter_flow/request_manager.dart'; -import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; -class VisitHistoryPageModel extends FlutterFlowModel { - final _visitHistoryManager = StreamRequestManager(); - Stream visitHistory({ - String? uniqueQueryKey, - bool? overrideCache, - required Stream Function() requestFn, - }) => - _visitHistoryManager.performRequest( - uniqueQueryKey: uniqueQueryKey, - overrideCache: overrideCache, - requestFn: requestFn, - ); - void clearVisitHistoryCache() => _visitHistoryManager.clear(); - void clearVisitHistoryCacheKey(String? uniqueKey) => - _visitHistoryManager.clearRequest(uniqueKey); - - /// Local state fields for this page. - - List visitorJsonList = []; - void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); - void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); - void removeAtIndexFromVisitorJsonList(int index) => - visitorJsonList.removeAt(index); - void insertAtIndexInVisitorJsonList(int index, dynamic item) => - visitorJsonList.insert(index, item); - void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => - visitorJsonList[index] = updateFn(visitorJsonList[index]); - - String visitorStrList = '0'; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - // State field(s) for TabBar widget. - TabController? tabBarController; - int get tabBarCurrentIndex => - tabBarController != null ? tabBarController!.index : 0; - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - DateTime? datePicked1; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - DateTime? datePicked2; - // State field(s) for DropDown widget. - String? dropDownValue1; - FormFieldController? dropDownValueController1; - // State field(s) for DropDown widget. - String? dropDownValue2; - FormFieldController? dropDownValueController2; - // State field(s) for Switch widget. - bool? switchValue; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - tabBarController?.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - clearVisitHistoryCache(); - } - - /// Action blocks. - Future getVisitorsActionPage( - BuildContext context, { - List? visitorsJsonList, - }) async { - visitorJsonList = visitorsJsonList!.toList().cast(); - } - - Future toggleCurrentSelectionHeader( - BuildContext context, { - required bool? toggleIndexValue, - }) async { - if (toggleIndexValue == true) { - return true; - } - - return false; - } -} diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index 64bfc9c6..b688d554 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -1,753 +1,155 @@ -import 'dart:developer'; - -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; - -import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import 'package:hub/flutter_flow/custom_functions.dart'; -import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_action.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/nav/nav.dart'; - -import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; -class VisitHistoryPageWidget extends StatefulWidget { - const VisitHistoryPageWidget({ - super.key, - this.visitorStrList, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempBol, - this.visitObsStr, - this.visitorJsonList, - }); +class VisitHistoryWidget extends StatelessWidget { + final ScheduleCompleteVisitPageModel _model; + final Function safeSetState; - final String? visitorStrList; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final bool? visitTempBol; - final String? visitObsStr; - final List? visitorJsonList; - - @override - State createState() => _VisitHistoryPageWidgetState(); -} - -class _VisitHistoryPageWidgetState extends State - with TickerProviderStateMixin { - late VisitHistoryPageModel _model; - int _visitHistoryLoadingIdx = 0; - final int _visitHistoryLoadingCount = 10; - List _visitHistoryList = []; - ScrollController _visitHistoryController = ScrollController(); - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => VisitHistoryPageModel()); - - // On page load action. - SchedulerBinding.instance.addPostFrameCallback((_) async { - if ((widget.visitorStrList != null && widget.visitorStrList != '') && - ((widget.visitorJsonList != null && - (widget.visitorJsonList)!.isNotEmpty) != - null)) { - _model.visitorJsonList = widget.visitorJsonList! - .where((e) => - widget.visitorStrList == - getJsonField( - e, - r'''$.VTE_DOCUMENTO''', - ).toString().toString()) - .toList() - .toList() - .cast(); - _model.visitorStrList = widget.visitorStrList!; - setState(() {}); - } else { - return; - } - }); - - _model.tabBarController = TabController( - vsync: this, - length: 2, - initialIndex: 0, - )..addListener(() => setState(() {})); - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.switchValue = true; - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - } - - void _loadMoreVisitHistory() async { - // Simulate fetching data from an API or database - Future> fetchVisitHistory(int start, int limit) async { - // Simulate network delay - await Future.delayed(Duration(seconds: 1)); - // Generate a list of visit history items - return List.generate(limit, (index) => "Item ${start + index}"); - } - - // Calculate the start index for the next batch of items to load - final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; - // Fetch the next batch of items - final List newItems = - await fetchVisitHistory(start, _visitHistoryLoadingCount); - - // If new items were fetched, add them to the list and update the index - if (newItems.isNotEmpty) { - _visitHistoryList.addAll(newItems); - _visitHistoryLoadingIdx++; - setState(() {}); - } - } - - void_scrollListener() { - if (_visitHistoryController.position.pixels == - _visitHistoryController.position.maxScrollExtent) { - _loadMoreVisitHistory(); - } - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } + const VisitHistoryWidget({ + Key? key, + required ScheduleCompleteVisitPageModel model, + required this.safeSetState, + }) : _model = model, + super(key: key); @override Widget build(BuildContext context) { - context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarScheduleCompleteVisit(context), - body: - bodyScheduleCompleteVisit(context, _model, setState, safeSetState), + return Container( + width: double.infinity, + height: 900.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, ), - ); - } -} - -PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '61lcxdgm' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyScheduleCompleteVisit(BuildContext context, - VisitHistoryPageModel _model, Function setState, Function safeSetState) { - return SafeArea( - top: true, - child: visitHistory(context, _model, safeSetState), - ); -} - -Widget visitHistory( - BuildContext context, - VisitHistoryPageModel _model, - Function safeSetState, -) { - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ], - ), - StreamBuilder( - stream: _model.visitHistory( + child: Consumer( + builder: (context, model, _) { + return StreamBuilder( + stream: model.visitHistory( requestFn: () => PhpGroup.getVisitsCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, cliID: FFAppState().cliUUID, atividade: 'getVisitas', + pageSize: 100, + pageNumber: 1, ), ), builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { + if (snapshot.connectionState == ConnectionState.waiting) { return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), ); + } else if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { + return const Center(child: Text('No visits found')); } final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - // visitaWrap.length, (visitaWrapIndex) { - - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - useSafeArea: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: getJsonField( - visitaWrapItem, - r'''$.VAW_OBS''', - ).toString(), - visitorImgPath: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - visitorStrList: getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitStatusColor: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString() == - 'A' - ? FlutterFlowTheme.of(context).success - : FlutterFlowTheme.of(context).error, - visitorJsonList: - PhpGroup.getVisitsCall.visitasList( - wrapGetVisitsResponse.jsonBody, - ), - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Card( - clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'i46frqyi' /* Visitante: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - '73b1kj59' /* Início em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'klzzrfbn' /* Fim em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme - .of(context) - .success; - } else if ((jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FlutterFlowTheme - .of(context) - .error; - } else if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme - .of(context) - .warning; - } else { - return FlutterFlowTheme - .of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - () { - if (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Ativo', - enText: 'Active', - ); - } else if ((jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ); - } else { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ), - ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - ], - ), - ), - ), - ); - }); + final visitaWrap = PhpGroup.getVisitsCall + .visitasList(wrapGetVisitsResponse.jsonBody) + ?.toList() ?? + []; + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + return CardItemTemplateComponentWidget( + imageHashMap: { + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }, + labelsHashMap: { + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }, + statusHashMap: [ + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.unknown) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.canceled) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.blocked) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.inactive) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Inactive', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }, + ], + onTapCardItemAction: () async { + showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return buildDetails( + visitaWrapItem, + context, + changeStatusAction, + ); + }, + ); + }, + ); }, ); }, - ) - ], + ); + }, ), - ), - ); + ); + } } diff --git a/pubspec.lock b/pubspec.lock index d60bd97b..db941ddb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -233,14 +233,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.5" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - sha256: "6d48a10b93590ab83eb092bee5adacdeb14f3d83f527a4b9e4092c363d56e2a8" - url: "https://pub.dev" - source: hosted - version: "3.1.0" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 828e33cd..95aa0238 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,7 +49,6 @@ dependencies: flutter_plugin_android_lifecycle: 2.0.20 share_plus: ^9.0.0 flutter_secure_storage: 9.2.2 - eva_icons_flutter: ^3.1.0 flutter_secure_storage_linux: 1.2.1 flutter_secure_storage_macos: 3.1.2 flutter_secure_storage_platform_interface: 1.1.2 From 7838a4b2cc1b847304c64c2bf5d5cc81e6b004aa Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:28:58 -0300 Subject: [PATCH 38/72] WIP --- .../preferences_settings_page/preferences_settings_model.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 7ed3cef2..757a2791 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -180,6 +180,7 @@ class PreferencesPageModel with ChangeNotifier { ); }).catchError((err) { log(err.toString()); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( From 05348452999dbf5a9538c5b4c8de9d80f98d1e69 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:40:36 -0300 Subject: [PATCH 39/72] WIP --- ...siter_vistor_template_component_widget.dart | 4 ---- .../liberation_history_widget.dart | 18 +++++++++--------- .../message_history_page_widget.dart | 1 - .../preferences_settings_model.dart | 16 ++++------------ 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index adaec865..eeee1b09 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -104,9 +104,6 @@ class _RegisiterVistorTemplateComponentWidgetState Widget build(BuildContext context) { BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); - log(context - .describeWidget('RegisiterVistorTemplateComponentWidget') - .toString()); return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( @@ -801,7 +798,6 @@ class _RegisiterVistorTemplateComponentWidgetState child: FFButtonWidget( onPressed: _isFormValid(context) ? () async { - log(visitorAlreadyRegistered.value.toString()); if (visitorAlreadyRegistered.value == true) { _model.imgBase64 = await actions.convertImageFileToBase64( diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index ef9bed94..1ac7cde3 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -421,15 +421,15 @@ Widget liberationHistoryItemCard( Navigator.pop(context); await answersRequest .call( - context, - liberationHistoryItem['NOT_ID'].toString(), - 'L', - 'Mensagem', - liberationHistoryItem['VTE_ID'].toString(), - ) - .then((value) { - log(value.toString()); - }); + context, + liberationHistoryItem['NOT_ID'] + .toString(), + 'L', + 'Mensagem', + liberationHistoryItem['VTE_ID'] + .toString(), + ) + .then((value) {}); }, options: FFButtonOptions( width: 100, diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 7c6d07dd..81e48c79 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -247,7 +247,6 @@ Widget buildListView( } Widget buildListItem(BuildContext context, dynamic jsonBody) { - log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Card( diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 757a2791..1746e73d 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -39,7 +39,6 @@ class PreferencesPageModel with ChangeNotifier { padding: MediaQuery.viewInsetsOf(context), child: PassKeyTemplateWidget( toggleActionStatus: (key) async { - log(key); FFAppState().fingerprintPass = key; FFAppState().fingerprint = true; }, @@ -64,8 +63,6 @@ class PreferencesPageModel with ChangeNotifier { ), ); }).catchError((err, stack) { - log(err.toString()); - log(stack.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -179,7 +176,6 @@ class PreferencesPageModel with ChangeNotifier { ), ); }).catchError((err) { - log(err.toString()); Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( @@ -283,7 +279,6 @@ class PreferencesPageModel with ChangeNotifier { tarefa: 'I', ) .then((value) { - log(value.jsonBody['error'].toString()); if (value.jsonBody['error'] == false) { FFAppState().deleteCliUUID(); FFAppState().deleteLocal(); @@ -315,7 +310,7 @@ class PreferencesPageModel with ChangeNotifier { }) // ignore: body_might_complete_normally_catch_error .catchError((err, stack) { - log(err.toString()); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -338,7 +333,7 @@ class PreferencesPageModel with ChangeNotifier { }); notifyListeners(); } catch (err, stack) { - log(err.toString()); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -452,6 +447,7 @@ class PreferencesPageModel with ChangeNotifier { } }).catchError((err) { log(err.toString()); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -474,7 +470,7 @@ class PreferencesPageModel with ChangeNotifier { }); notifyListeners(); } catch (err, stack) { - log(err.toString()); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -589,8 +585,6 @@ class PreferencesPageModel with ChangeNotifier { } }).catchError((error, StackTrace) { // FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -682,8 +676,6 @@ class PreferencesPageModel with ChangeNotifier { }).catchError((e, s) { // FFAppState().panic = false; - log(e.toString()); - log(s.toString()); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( From fc77d6776720e63ad8d0678ecef4e6e68309f58f Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:43:05 -0300 Subject: [PATCH 40/72] WIP --- .../preferences_settings_page/preferences_settings_model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 1746e73d..fde9d040 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -147,7 +147,6 @@ class PreferencesPageModel with ChangeNotifier { ), FFButtonWidget( onPressed: () async { - FFAppState().notify = !FFAppState().notify; PhpGroup.changeNotifica .call( userUUID: FFAppState().userUUID, @@ -157,6 +156,8 @@ class PreferencesPageModel with ChangeNotifier { notifica: FFAppState().notify ? 'S' : 'N', ) .then((value) { + FFAppState().notify = !FFAppState().notify; + ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( From 929c18ba9e19b7f999b2bb9d05315818cecf6a2e Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:45:19 -0300 Subject: [PATCH 41/72] WIP --- .../preferences_settings_model.dart | 101 ++++++++++-------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index fde9d040..537fca14 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -147,56 +147,63 @@ class PreferencesPageModel with ChangeNotifier { ), FFButtonWidget( onPressed: () async { - PhpGroup.changeNotifica - .call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - notifica: FFAppState().notify ? 'S' : 'N', - ) - .then((value) { - FFAppState().notify = !FFAppState().notify; + try { + PhpGroup.changeNotifica + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + notifica: FFAppState().notify ? 'S' : 'N', + ) + .then((value) { + FFAppState().notify = !FFAppState().notify; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Notificação alterada com sucesso', - enText: 'Notification changed successfully', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: - FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Notificação alterada com sucesso', + enText: 'Notification changed successfully', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), ), - ), - ); - }).catchError((err) { + ); + }).catchError((err) { + Navigator.pop(context); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).whenComplete(() => notifyListeners()); + } on Exception catch (e) { + log(e.toString()); Navigator.pop(context); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Error changing notification', - ptText: 'Erro ao alterar notificação', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).error, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - }).whenComplete(() => notifyListeners()); - Navigator.pop(context); + } }, text: FFLocalizations.of(context).getVariableText( enText: 'Yes', From 5e99d8cb02b76b5dafa2cd0560827b32f0a5a927 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:48:47 -0300 Subject: [PATCH 42/72] WIP --- .../preferences_settings_model.dart | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 537fca14..edbb049e 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -157,27 +157,32 @@ class PreferencesPageModel with ChangeNotifier { notifica: FFAppState().notify ? 'S' : 'N', ) .then((value) { - FFAppState().notify = !FFAppState().notify; + if (value.jsonBody['error'] == false) { + Navigator.pop(context); + FFAppState().notify = !FFAppState().notify; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Notificação alterada com sucesso', - enText: 'Notification changed successfully', - ), - style: TextStyle( - color: - FlutterFlowTheme.of(context).info)), - backgroundColor: - FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Notificação alterada com sucesso', + enText: + 'Notification changed successfully', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), ), - ), - ); + ); + } }).catchError((err) { Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( From 1da4899d5ad431f0f5b835d5d207a4bc9dad56ce Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 08:50:20 -0300 Subject: [PATCH 43/72] WIP --- .../preferences_settings_model.dart | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index edbb049e..624a8b0a 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -157,8 +157,8 @@ class PreferencesPageModel with ChangeNotifier { notifica: FFAppState().notify ? 'S' : 'N', ) .then((value) { + Navigator.pop(context); if (value.jsonBody['error'] == false) { - Navigator.pop(context); FFAppState().notify = !FFAppState().notify; ScaffoldMessenger.of(context).showSnackBar( @@ -182,6 +182,26 @@ class PreferencesPageModel with ChangeNotifier { ), ), ); + } else { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao alterar notificação', + enText: 'Error changing notification', + ), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); } }).catchError((err) { Navigator.pop(context); From 09b339da8de7c18456aed395a1b77696a5f23a89 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 09:11:00 -0300 Subject: [PATCH 44/72] WIP --- .../view_visit_detail/view_visit_detail_widget.dart | 9 ++++----- .../preferences_settings_model.dart | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index 647a9541..30bcd778 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -3,6 +3,7 @@ import 'dart:developer'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/serialization_util.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; @@ -841,6 +842,8 @@ class _ViewVisitDetailWidgetState extends State { false) { Navigator.pop(context); } else { + final error = + await DialogUtil.errorDefault(context); await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -849,11 +852,7 @@ class _ViewVisitDetailWidgetState extends State { builder: (context) { return Padding( padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.deleteVisitCall.msg( - (_model.deleteVisit?.jsonBody ?? ''), - )!, - ), + child: error, ); }, ).then((value) => safeSetState(() {})); diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 624a8b0a..b813378d 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -157,10 +157,10 @@ class PreferencesPageModel with ChangeNotifier { notifica: FFAppState().notify ? 'S' : 'N', ) .then((value) { - Navigator.pop(context); if (value.jsonBody['error'] == false) { - FFAppState().notify = !FFAppState().notify; + Navigator.pop(context); + FFAppState().notify = !FFAppState().notify; ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( From ccd63168bd52f24543d9c56ba0fc5501bdd0c202 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 13:52:00 -0300 Subject: [PATCH 45/72] WIP --- .../local_profile_component_widget.dart | 60 ++- .../details_component_action.dart | 3 +- .../details_component_widget.dart | 371 ++++++++-------- lib/flutter_flow/nav/nav.dart | 28 -- lib/main.dart | 4 +- .../liberation_history_widget.dart | 413 +++++++++--------- .../schedule_complete_visit_page_model.dart | 15 +- .../schedule_complete_visit_page_widget.dart | 17 +- .../visit_history_page_widget.dart | 270 +++++++----- 9 files changed, 587 insertions(+), 594 deletions(-) diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index ab338b78..3120a876 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,4 +1,3 @@ - import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -12,10 +11,7 @@ export 'local_profile_component_model.dart'; //// class LocalProfileComponentWidget extends StatefulWidget { - const LocalProfileComponentWidget({ - required bool localStatus, - super.key - }); + const LocalProfileComponentWidget({required bool localStatus, super.key}); @override State createState() => @@ -87,35 +83,34 @@ class _LocalProfileComponentWidgetState padding: MediaQuery.viewInsetsOf(context), child: const SizedBox( height: double.infinity, - child: - BottomArrowLinkedLocalsComponentWidget(), + child: BottomArrowLinkedLocalsComponentWidget(), ), ); }, ).then((value) => safeSetState(() {})); }, child: ClipRRect( - borderRadius: BorderRadius.circular(200.0), - child: - Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + borderRadius: BorderRadius.circular(200.0), + child: Image.network( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', width: 80.0, height: 80.0, fit: BoxFit.cover, alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => Image.asset('assets/images/error_image.svg'), - ), - ) - ), - ), + errorBuilder: (context, error, stackTrace) => + Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + errorBuilder: (context, error, stackTrace) => + Image.asset('assets/images/error_image.svg'), + ), + )), ), ), + ), Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -125,16 +120,15 @@ class _LocalProfileComponentWidgetState functions.convertToUppercase(FFAppState().local), 'NOME DO LOCAL', ), - style: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).info, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), ), ], ), @@ -148,4 +142,4 @@ class _LocalProfileComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index fafb0916..0225d38f 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -84,7 +84,6 @@ Widget buildDetails( ) .then((value) { Navigator.pop(context); - Navigator.pop(context); if (value == false) { showSnackbar( context, @@ -105,6 +104,8 @@ Widget buildDetails( ); } }).catchError((err, stack) { + Navigator.pop(context); + showSnackbar( context, FFLocalizations.of(context).getVariableText( diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index bc8e40f1..7ebbd254 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -91,217 +91,210 @@ class _VisitRequestTemplateComponentWidgetState return LayoutBuilder( builder: (context, constraints) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Container( - width: constraints.maxWidth, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 150.0, - height: 150.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', - fit: BoxFit.cover, - ), + return Container( + width: constraints.maxWidth, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 150.0, + height: 150.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), - Row( - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries - .map((MapEntry item) { - return Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), - child: TextFormField( - // controller: _model.textControllerStatus, - // focusNode: _model.textFieldFocusNodeStatus, - autofocus: false, - canRequestFocus: false, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: item.value, - ), - ), - filled: true, - fillColor: item.value, - labelText: item.key, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).accent1, + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + fit: BoxFit.cover, + ), + ), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 24.0), + child: TextFormField( + // controller: _model.textControllerStatus, + // focusNode: _model.textFieldFocusNodeStatus, + autofocus: false, + canRequestFocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: item.value, ), ), - style: FlutterFlowTheme.of(context) - .bodyMedium + filled: true, + fillColor: item.value, + labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - ); - }).toList(); - }).toList(), - ), - ListView.builder( - shrinkWrap: true, - itemCount: labelsLinkedHashMap.length, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - String key = labelsLinkedHashMap.keys.elementAt(index); - String value = labelsLinkedHashMap[key]!; - // return Text('key: $key, value: $value'); - return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10.0, vertical: 3.0), - child: TextFormField( - readOnly: true, - initialValue: '$value', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily, - ), - ), - decoration: InputDecoration( - labelText: key, - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).info, ), ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium + style: FlutterFlowTheme.of(context) + .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily, - ), + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily, - ), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - errorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), ), ), ); - }, - ), - if (widget.buttons.isNotEmpty) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons, + }).toList(); + }).toList(), + ), + ListView.builder( + shrinkWrap: true, + itemCount: labelsLinkedHashMap.length, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String key = labelsLinkedHashMap.keys.elementAt(index); + String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10.0, vertical: 3.0), + child: TextFormField( + readOnly: true, + initialValue: '$value', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily, + ), + ), + decoration: InputDecoration( + labelText: key, + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, + ), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + ), ), + ); + }, + ), + if (widget.buttons.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons, ), - ] - .divide(const SizedBox(height: 20.0)) - .addToEnd(const SizedBox(height: 20.0)) - .addToStart(const SizedBox(height: 20.0)), - ), + ), + ] + .divide(const SizedBox(height: 20.0)) + .addToEnd(const SizedBox(height: 20.0)) + .addToStart(const SizedBox(height: 20.0)), ), ); }, diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 68bfc993..8324d836 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -97,38 +97,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'scheduleCompleteVisitPage', path: '/scheduleCompleteVisitPage', builder: (context, params) => ScheduleCompleteVisitPageWidget( - // get current datatime picker dd/mm/aaaa hh:mm:ss - // visitStartDateStr: DateTime.now().toString(), - // post 1 day - // visitEndDateStr: DateTime.now().add(const Duration(days: 1)).toString(), visitorStrList: params.getParam( 'visitorStrList', ParamType.String, ), - visitStartDateStr: params.getParam( - 'visitStartDateStr', - ParamType.String, - ), - visitEndDateStr: params.getParam( - 'visitEndDateStr', - ParamType.String, - ), - visitReasonStr: params.getParam( - 'visitReasonStr', - ParamType.String, - ), - visitLevelStr: params.getParam( - 'visitLevelStr', - ParamType.String, - ), - visitTempBol: params.getParam( - 'visitTempBol', - ParamType.bool, - ), - visitObsStr: params.getParam( - 'visitObsStr', - ParamType.String, - ), visitorJsonList: params.getParam( 'visitorJsonList', ParamType.JSON, diff --git a/lib/main.dart b/lib/main.dart index 61119468..31a077e1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,14 +20,14 @@ void main() async { DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); - await initializeApp(); + await init(); runApp(ChangeNotifierProvider( create: (context) => FFAppState(), child: const MyApp(), )); } -Future initializeApp() async { +Future init() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; await FlutterFlowTheme.initialize(); diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 1ac7cde3..72c0dcf2 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -330,71 +330,110 @@ Widget liberationHistoryItemCard( }) ], onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, + showDialog( + // isScrollControlled: true, + // isDismissible: true, + // backgroundColor: Colors.transparent, useSafeArea: true, context: context, builder: (context) { - return VisitRequestTemplateComponentWidget( - // vteName: liberationHistoryItem['VTE_NOME'], - // vteReason: liberationHistoryItem['NOT_MOTIVO'], - // vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - // ? liberationHistoryItem['NOT_DTENVIO'] - // : liberationHistoryItem['NOT_DTRESPOSTA'], - // vawStatus: liberationHistoryItem['NOT_STATUS'], - // vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - // vteUUID: liberationHistoryItem['VTE_ID'], - // cliUUID: FFAppState().cliUUID, - // msgUUID: liberationHistoryItem['NOT_ID'], - // vawDestino: liberationHistoryItem['NOT_DESTINO'], - // vawUUID: liberationHistoryItem['NOT_ID'], - // vawName: liberationHistoryItem['NOT_NOME'], - // vawRef: liberationHistoryItem['NOT_ID'], - labelsHashMap: Map.from({ - 'Nome:': liberationHistoryItem['VTE_NOME'], - 'Data:': liberationHistoryItem['NOT_DTENVIO'], - 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], - 'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'], - // 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'], - }), - buttons: [ - if (liberationHistoryItem['NOT_STATUS'] == 'S') - FlutterFlowIconButton( - icon: const Icon(Icons.done), - onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Aprovar Visita', - enText: 'Approve Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja aprovar essa visita?', - enText: - 'Are you sure you want to approve this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: - FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', + return Dialog( + alignment: Alignment.center, + child: VisitRequestTemplateComponentWidget( + // vteName: liberationHistoryItem['VTE_NOME'], + // vteReason: liberationHistoryItem['NOT_MOTIVO'], + // vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' + // ? liberationHistoryItem['NOT_DTENVIO'] + // : liberationHistoryItem['NOT_DTRESPOSTA'], + // vawStatus: liberationHistoryItem['NOT_STATUS'], + // vteMsg: liberationHistoryItem['NOT_MSGENVIO'], + // vteUUID: liberationHistoryItem['VTE_ID'], + // cliUUID: FFAppState().cliUUID, + // msgUUID: liberationHistoryItem['NOT_ID'], + // vawDestino: liberationHistoryItem['NOT_DESTINO'], + // vawUUID: liberationHistoryItem['NOT_ID'], + // vawName: liberationHistoryItem['NOT_NOME'], + // vawRef: liberationHistoryItem['NOT_ID'], + labelsHashMap: Map.from({ + 'Nome:': liberationHistoryItem['VTE_NOME'], + 'Data:': liberationHistoryItem['NOT_DTENVIO'], + 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], + 'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'], + // 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'], + }), + buttons: [ + if (liberationHistoryItem['NOT_STATUS'] == 'S') + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Aprovar Visita', + enText: 'Approve Visit', ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: + 'Are you sure you want to approve this visit?', + ), + ), + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + Navigator.pop(context); + Navigator.pop(context); + await answersRequest + .call( + context, + liberationHistoryItem['NOT_ID'] + .toString(), + 'L', + 'Mensagem', + liberationHistoryItem['VTE_ID'] + .toString(), + ) + .then((value) {}); + }, + options: FFButtonOptions( width: 100, height: 40, color: FlutterFlowTheme.of(context) @@ -408,86 +447,82 @@ Widget liberationHistoryItemCard( .primaryBackground, width: 1, ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: - FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - Navigator.pop(context); - Navigator.pop(context); - await answersRequest - .call( - context, - liberationHistoryItem['NOT_ID'] - .toString(), - 'L', - 'Mensagem', - liberationHistoryItem['VTE_ID'] - .toString(), - ) - .then((value) {}); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + borderRadius: BorderRadius.circular(10), ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, + ), + ], + ); + }); + }, + ), + if (liberationHistoryItem['NOT_STATUS'] == 'S') + FlutterFlowIconButton( + icon: const Icon(Icons.close), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: + 'Are you sure you want to block this visit?', + ), + ), + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'No', + ptText: 'Não', ), - borderRadius: BorderRadius.circular(10), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10)), ), - ), - ], - ); - }); - }, - ), - if (liberationHistoryItem['NOT_STATUS'] == 'S') - FlutterFlowIconButton( - icon: const Icon(Icons.close), - onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja bloquear essa visita?', - enText: - 'Are you sure you want to block this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: - FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + await answersRequest.call( + context, + liberationHistoryItem['NOT_ID'] + .toString(), + 'B', + 'Mensagem', + liberationHistoryItem['VTE_ID'] + .toString(), + ); + }, + options: FFButtonOptions( width: 100, height: 40, color: FlutterFlowTheme.of(context) @@ -501,74 +536,44 @@ Widget liberationHistoryItemCard( .primaryBackground, width: 1, ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: - FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - await answersRequest.call( - context, - liberationHistoryItem['NOT_ID'].toString(), - 'B', - 'Mensagem', - liberationHistoryItem['VTE_ID'].toString(), - ); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + borderRadius: BorderRadius.circular(10), ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), ), - ), - ], - ); - }); - }, - ), - ], - statusHashMap: [ - liberationHistoryItem['NOT_STATUS'] == 'L' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Finalizado', - enText: 'Finished', - ): FlutterFlowTheme.of(context).success, - }) - : liberationHistoryItem['NOT_STATUS'] == 'B' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).warning, - }) - ], - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), - // changeStatusAction: answersRequest, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], + ], + ); + }); + }, + ), + ], + statusHashMap: [ + liberationHistoryItem['NOT_STATUS'] == 'L' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }) + : liberationHistoryItem['NOT_STATUS'] == 'B' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }) + ], + imageHashMap: Map.from({ + 'key': liberationHistoryItem['VTE_ID'], + 'value': 'E', + }), + // changeStatusAction: answersRequest, + // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], + ), ); }, ).then((_) { diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 022d79b9..3ce328e6 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -2,6 +2,7 @@ import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/request_manager.dart'; @@ -164,11 +165,21 @@ class ScheduleCompleteVisitPageModel ); textFieldFocusNode1 = FocusNode(); - textController1 = TextEditingController(); + textController1 = TextEditingController( + text: dateTimeFormat( + 'd/M/y H:mm:ss', + DateTime.now().add(const Duration(minutes: 10)), + // locale: FFLocalizations.of(context).languageCode, + )); textController1Validator = _textController1Validator; textFieldFocusNode2 = FocusNode(); - textController2 = TextEditingController(); + textController2 = TextEditingController( + text: dateTimeFormat( + 'd/M/y H:mm:ss', + DateTime.now().add(const Duration(days: 1)), + // locale: FFLocalizations.of(context).languageCode, + )); textController2Validator = _textController2Validator; textFieldFocusNode3 = FocusNode(); diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 0ca53309..733a5bcc 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -29,22 +29,10 @@ class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ super.key, this.visitorStrList, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempBol, - this.visitObsStr, this.visitorJsonList, }); final String? visitorStrList; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final bool? visitTempBol; - final String? visitObsStr; final List? visitorJsonList; @override @@ -250,10 +238,7 @@ Widget bodyScheduleCompleteVisit( scheduleVisit(context, _model, setState, safeSetState), wrapWithModel( model: _model, - child: VisitHistoryWidget( - model: _model, - safeSetState: safeSetState, - ), + child: VisitHistoryWidget(), updateCallback: () { setState(() {}); }, diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index b688d554..b7291b9f 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:hub/actions/actions.dart'; import 'package:hub/app_state.dart'; @@ -6,144 +8,174 @@ import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_action.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; -class VisitHistoryWidget extends StatelessWidget { - final ScheduleCompleteVisitPageModel _model; - final Function safeSetState; - - const VisitHistoryWidget({ +class VisitHistoryWidget extends StatefulWidget { + VisitHistoryWidget({ Key? key, - required ScheduleCompleteVisitPageModel model, - required this.safeSetState, - }) : _model = model, - super(key: key); + }) : super(key: key); + @override + _VisitHistoryWidgetState createState() => _VisitHistoryWidgetState(); +} + +class _VisitHistoryWidgetState extends State { @override Widget build(BuildContext context) { + var response = ScheduleCompleteVisitPageModel().visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + pageSize: 100, + pageNumber: 1, + ), + ); return Container( width: double.infinity, height: 900.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, ), - child: Consumer( - builder: (context, model, _) { - return StreamBuilder( - stream: model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - pageSize: 100, - pageNumber: 1, + // child: Consumer( + child: StreamBuilder( + stream: response, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), ), - ), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, - ), - ), - ); - } else if (snapshot.hasError) { - return Center(child: Text('Error: ${snapshot.error}')); - } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { - return const Center(child: Text('No visits found')); - } - final wrapGetVisitsResponse = snapshot.data!; - final visitaWrap = PhpGroup.getVisitsCall - .visitasList(wrapGetVisitsResponse.jsonBody) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - return CardItemTemplateComponentWidget( - imageHashMap: { - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', + ); + } else if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { + return const Center(child: Text('No visits found')); + } + var wrapGetVisitsResponse = snapshot.data!; + var visitaWrap = PhpGroup.getVisitsCall + .visitasList(wrapGetVisitsResponse.jsonBody) + ?.toList() ?? + []; + log('updated'); + log('visitaWrap: ${visitaWrap[0]}'); + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + return CardItemTemplateComponentWidget( + imageHashMap: { + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }, + labelsHashMap: { + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }, + statusHashMap: [ + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, }, - labelsHashMap: { - 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', - 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', - 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.finished) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, }, - statusHashMap: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.active) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).warning, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Finalizado', - enText: 'Finished', - ): FlutterFlowTheme.of(context).success, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.unknown) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.canceled) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.blocked) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.inactive) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Inactive', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).error, - }, - ], - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return buildDetails( - visitaWrapItem, - context, - changeStatusAction, - ); - }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.canceled) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.inactive) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Inactive', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }, + ], + onTapCardItemAction: () async { + await showDialog( + // isScrollControlled: true, + // isDismissible: true, + // backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + + builder: (context) { + return Dialog( + alignment: Alignment.center, + child: buildDetails( + visitaWrapItem, + context, + changeStatusAction, + ), ); }, - ); + ).whenComplete(() async { + log('Complete'); + final newResponseStream = + ScheduleCompleteVisitPageModel().visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + pageSize: 100, + pageNumber: 1, + ), + ); + newResponseStream.listen((newResponse) { + log('New response received: $newResponse'); + if (mounted) { + safeSetState(() { + response = newResponse.jsonBody; + log('Response updated: $response'); + }); + } else { + log('Widget is not mounted, skipping state update.'); + } + }).onError((err) { + log('Error: $err'); + }); + }).catchError((err, stack) { + log('Error: $err'); + log('Stack: $stack'); + }); }, ); }, From d26eb5d8fa205f01d6160d1d79b950460b6d9c88 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 14:34:39 -0300 Subject: [PATCH 46/72] WIP --- .../details_component_action.dart | 156 ++++++------------ lib/flutter_flow/flutter_flow_util.dart | 8 +- .../visit_history_page_widget.dart | 18 +- 3 files changed, 57 insertions(+), 125 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 0225d38f..4a7ad9c8 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -25,115 +25,57 @@ Widget buildDetails( FlutterFlowIconButton( icon: const Icon(Icons.close), onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', - ), + showAlertDialog( + context, + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Você tem certeza que deseja bloquear essa visita?', + enText: 'Are you sure you want to block this visit?', + ), () async { + await changeStatusAction + ?.call( + context, + int.parse(visitaWrapItem['VAW_DESTINO']), + int.parse(visitaWrapItem['VAW_ID']), + visitaWrapItem['VAW_CHAVE'] ?? '', + visitaWrapItem['VTE_DOCUMENTO'] ?? '', + ) + .then((value) { + Navigator.pop(context); + if (value == false) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error blocking visit', + ptText: 'Erro ao bloquear visita', ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja bloquear essa visita?', - enText: 'Are you sure you want to block this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: - FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - await changeStatusAction - ?.call( - context, - int.parse(visitaWrapItem['VAW_DESTINO']), - int.parse(visitaWrapItem['VAW_ID']), - visitaWrapItem['VAW_CHAVE'] ?? '', - visitaWrapItem['VTE_DOCUMENTO'] ?? '', - ) - .then((value) { - Navigator.pop(context); - if (value == false) { - showSnackbar( - context, - FFLocalizations.of(context).getVariableText( - enText: 'Error blocking visit', - ptText: 'Erro ao bloquear visita', - ), - true, - ); - } else if (value == true) { - showSnackbar( - context, - FFLocalizations.of(context).getVariableText( - enText: 'Success canceling visit', - ptText: 'Succeso ao cancelar visita', - ), - false, - ); - } - }).catchError((err, stack) { - Navigator.pop(context); - - showSnackbar( - context, - FFLocalizations.of(context).getVariableText( - enText: 'Error blocking visit', - ptText: 'Erro ao bloquear visita', - ), - true, - ); - }); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], + true, ); - }); + } else if (value == true) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Success canceling visit', + ptText: 'Succeso ao cancelar visita', + ), + false, + ); + } + }).catchError((err, stack) { + Navigator.pop(context); + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error blocking visit', + ptText: 'Erro ao bloquear visita', + ), + true, + ); + }); + }); }, ), if (getStatus(visitaWrapItem['VAW_STATUS']) != diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 78192536..8d1ffe11 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -549,8 +549,8 @@ void showSnackbar( ); } -void showAlertDialog( - BuildContext context, String title, String content, Future action) { +void showAlertDialog(BuildContext context, String title, String content, + Future Function() action) { showDialog( context: context, builder: (context) { @@ -577,6 +577,7 @@ void showAlertDialog( width: 1, ), borderRadius: BorderRadius.circular(10), + elevation: 0, ), text: FFLocalizations.of(context).getVariableText( enText: 'No', @@ -585,12 +586,13 @@ void showAlertDialog( ), FFButtonWidget( onPressed: () async { - await action; + action(); }, options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.height * 0.05, color: FlutterFlowTheme.of(context).primaryBackground, + elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, ), diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index b7291b9f..4cb01778 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -63,8 +63,6 @@ class _VisitHistoryWidgetState extends State { .visitasList(wrapGetVisitsResponse.jsonBody) ?.toList() ?? []; - log('updated'); - log('visitaWrap: ${visitaWrap[0]}'); return ListView.builder( itemCount: visitaWrap.length, shrinkWrap: true, @@ -147,7 +145,6 @@ class _VisitHistoryWidgetState extends State { ); }, ).whenComplete(() async { - log('Complete'); final newResponseStream = ScheduleCompleteVisitPageModel().visitHistory( requestFn: () => PhpGroup.getVisitsCall.call( @@ -160,22 +157,13 @@ class _VisitHistoryWidgetState extends State { ), ); newResponseStream.listen((newResponse) { - log('New response received: $newResponse'); if (mounted) { safeSetState(() { response = newResponse.jsonBody; - log('Response updated: $response'); }); - } else { - log('Widget is not mounted, skipping state update.'); - } - }).onError((err) { - log('Error: $err'); - }); - }).catchError((err, stack) { - log('Error: $err'); - log('Stack: $stack'); - }); + } else {} + }).onError((err) {}); + }).catchError((err, stack) {}); }, ); }, From 1e997a6de6ffe158c92bc0ecf8e0329f3f797bfe Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 15:53:59 -0300 Subject: [PATCH 47/72] WIP --- ...iter_vistor_template_component_widget.dart | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index eeee1b09..13646efb 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -93,9 +93,9 @@ class _RegisiterVistorTemplateComponentWidgetState return false; } - if (_isVisitorRegistered) { - return false; - } + // if (_isVisitorRegistered) { + // return false; + // } return true; } @@ -271,10 +271,17 @@ class _RegisiterVistorTemplateComponentWidgetState .labelSmall .override( fontFamily: 'Nunito', - color: Color.alphaBlend( - Colors.white - .withOpacity(0.7), - Colors.red), + color: Theme.of(context) + .brightness == + Brightness.dark + ? Color.alphaBlend( + Colors.white + .withOpacity(0.7), + Colors.red) + : Color.alphaBlend( + Colors.black + .withOpacity(0.25), + Colors.red), fontSize: 13.0, letterSpacing: 0.0, )), From 016be1df546931cb731a5a0fdb8696db7b973532 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 8 Aug 2024 16:46:30 -0300 Subject: [PATCH 48/72] FIX: registerVisitor and visitHistory --- lib/backend/api_requests/api_calls.dart | 6 ++---- lib/backend/api_requests/api_manager.dart | 8 ++++---- .../details_component/details_component_widget.dart | 7 ++++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 1630cdd3..cefd8390 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -2550,8 +2550,7 @@ String _serializeList(List? list) { try { return json.encode(list, toEncodable: _toEncodable); } catch (_) { - if (kDebugMode) { - } + if (kDebugMode) {} return '[]'; } } @@ -2561,8 +2560,7 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { try { return json.encode(jsonVar, toEncodable: _toEncodable); } catch (_) { - if (kDebugMode) { - } + if (kDebugMode) {} return isList ? '[]' : '{}'; } } diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 53340d4f..14784b1c 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:core'; +import 'dart:developer'; import 'dart:io'; import 'dart:typed_data'; @@ -15,9 +16,6 @@ import '/flutter_flow/uploaded_file.dart'; import 'get_streamed_response.dart'; - - - enum ApiCallType { GET, POST, @@ -413,6 +411,8 @@ class ApiManager { ApiCallOptions? options, http.Client? client, }) async { + log('makeApiCall -> $params.toString()'); + final callOptions = options ?? ApiCallOptions( callName: callName, @@ -515,4 +515,4 @@ class ApiManager { return result; } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 7ebbd254..4dc13176 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -146,6 +146,7 @@ class _VisitRequestTemplateComponentWidgetState .override( fontFamily: FlutterFlowTheme.of(context) .labelMediumFamily, + fontWeight: FontWeight.bold, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() @@ -292,9 +293,9 @@ class _VisitRequestTemplateComponentWidgetState ), ), ] - .divide(const SizedBox(height: 20.0)) - .addToEnd(const SizedBox(height: 20.0)) - .addToStart(const SizedBox(height: 20.0)), + .divide(const Flexible(child: SizedBox(height: 20.0))) + .addToEnd(const Flexible(child: SizedBox(height: 20.0))) + .addToStart(const Flexible(child: SizedBox(height: 20.0))), ), ); }, From bc1c684d72c4bfa4f8170b6e720514f2cca64620 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 09:38:33 -0300 Subject: [PATCH 49/72] fix visitorRegister and visitHIstory --- lib/backend/api_requests/api_calls.dart | 60 ++-- .../details_component_action.dart | 2 +- ...siter_vistor_template_component_model.dart | 13 +- ...iter_vistor_template_component_widget.dart | 314 +++++++++--------- .../schedule_complete_visit_page_model.dart | 6 +- .../schedule_complete_visit_page_widget.dart | 32 +- .../visit_history_page_widget.dart | 279 ++++++++-------- 7 files changed, 350 insertions(+), 356 deletions(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index cefd8390..e238fc55 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -1417,53 +1417,39 @@ class PostProvVisitSchedulingCall { } class GetVisitsCall { - Stream call({ + Future call({ String? devUUID = '', String? userUUID = '', String? cliID = '', String? atividade = '', int? pageSize, int? pageNumber, - }) { + }) async { final baseUrl = PhpGroup.getBaseUrl(); - final StreamController controller = StreamController(); - Future.microtask( - () async { - try { - final response = await ApiManager.instance.makeApiCall( - callName: 'getVisits', - apiUrl: '$baseUrl/processRequest.php', - callType: ApiCallType.POST, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - params: { - 'devUUID': devUUID, - 'userUUID': userUUID, - 'cliID': cliID, - 'atividade': atividade, - 'pageSize': pageSize, - 'pageNumber': pageNumber, - }, - bodyType: BodyType.X_WWW_FORM_URL_ENCODED, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, - ); - controller.add(response); - controller.close(); - } catch (e) { - controller.addError(e); - controller.close(); - } + return ApiManager.instance.makeApiCall( + callName: 'getVisits', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + 'pageSize': pageSize, + 'pageNumber': pageNumber, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, ); - - return controller.stream; } bool? error(dynamic response) => castToType(getJsonField( diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 4a7ad9c8..a1250742 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -44,7 +44,7 @@ Widget buildDetails( visitaWrapItem['VTE_DOCUMENTO'] ?? '', ) .then((value) { - Navigator.pop(context); + Navigator.pop(context, value); if (value == false) { showSnackbar( context, diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index 3c65d365..bfc58996 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:developer'; import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; @@ -14,12 +15,20 @@ import 'regisiter_vistor_template_component_widget.dart'; class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. + Timer? _debounceTimer; final unfocusNode = FocusNode(); bool isDataUploading = false; FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); + void debounce(Function() fn, Duration time) { + if (_debounceTimer != null) { + _debounceTimer!.cancel(); + } + _debounceTimer = Timer(time, fn); + } + // State field(s) for TextField widget. FocusNode? textFieldFocusNode1; TextEditingController? textController1; @@ -35,7 +44,7 @@ class RegisiterVistorTemplateComponentModel return null; } - Future getVisitanteByDocument( + Future getVisitanteByDocument( String document, BuildContext context) async { final response = await PhpGroup.getVisitorByDocCall.call( devUUID: FFAppState().devUUID, @@ -49,7 +58,7 @@ class RegisiterVistorTemplateComponentModel response.jsonBody['error'] != 'false') { return true; } - return null; + return false; } // State field(s) for TextField widget. diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 13646efb..43bec841 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -39,10 +39,14 @@ class _RegisiterVistorTemplateComponentWidgetState final scaffoldKey = GlobalKey(); bool _isVisitorRegistered = false; + BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); @override void initState() { super.initState(); + + visitorAlreadyRegistered = BehaviorSubject.seeded(false); + _model = createModel(context, () => RegisiterVistorTemplateComponentModel()); @@ -93,16 +97,15 @@ class _RegisiterVistorTemplateComponentWidgetState return false; } - // if (_isVisitorRegistered) { - // return false; - // } + if (_isVisitorRegistered) { + return false; + } return true; } @override Widget build(BuildContext context) { - BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); return Align( alignment: const AlignmentDirectional(0.0, 1.0), @@ -226,71 +229,61 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), + onChanged: (value) { + _model.debounce(() async { + log('data'); + var data = await _model.getVisitanteByDocument( + value, context); + log('data: $data'); + setState(() { + _isVisitorRegistered = data; + }); + }, const Duration(milliseconds: 500)); + }, validator: _model.textController2Validator.asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), ], ), - FutureBuilder( - future: _model.textController2.text.isNotEmpty - ? _model.getVisitanteByDocument( - _model.textController2.text, context) - : null, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { - return const SizedBox(); - } else if (snapshot.hasError || - snapshot.data == null || - snapshot.data == '') { - // safeSetState(() => _isVisitorRegistered = false); - _isVisitorRegistered = false; - visitorAlreadyRegistered.add(true); - return const SizedBox(); - } else { - _isVisitorRegistered = true; - visitorAlreadyRegistered.add(false); - return _model.textController2.text.isEmpty - ? const SizedBox() - : Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.only( - top: 5, start: 12), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: - 'Visitor already registered', - ptText: 'Visitante já cadastrado', - ), - style: FlutterFlowTheme.of(context) - .labelSmall - .override( - fontFamily: 'Nunito', - color: Theme.of(context) - .brightness == - Brightness.dark - ? Color.alphaBlend( - Colors.white - .withOpacity(0.7), - Colors.red) - : Color.alphaBlend( - Colors.black - .withOpacity(0.25), - Colors.red), - fontSize: 13.0, - letterSpacing: 0.0, - )), - ), - ], - ); - } - }, - ), + _model.textController2.text.isEmpty + ? const SizedBox() + : _isVisitorRegistered == true + ? Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.only( + top: 5, start: 12), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito', + color: Theme.of(context) + .brightness == + Brightness.dark + ? Color.alphaBlend( + Colors.white + .withOpacity(0.7), + Colors.red) + : Color.alphaBlend( + Colors.black + .withOpacity(0.25), + Colors.red), + fontSize: 13.0, + letterSpacing: 0.0, + )), + ), + ], + ) + : const SizedBox() ]), ), Padding( @@ -805,111 +798,110 @@ class _RegisiterVistorTemplateComponentWidgetState child: FFButtonWidget( onPressed: _isFormValid(context) ? () async { - if (visitorAlreadyRegistered.value == true) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: _model.dropDownValue == - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ) - ? 'V' - : 'P', - foto: 'base64;jpeg,${_model.imgBase64}', - ) - .onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', ), ), ), - ); - }, - ); - }); - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - _model.dropDownValueController?.reset(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Visitante cadastrado com sucesso.', - enText: - 'Visitor successfully registered.'), - style: TextStyle( - color: - FlutterFlowTheme.of(context) - .info)), - backgroundColor: - FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 3), - width: MediaQuery.of(context).size.width, - behavior: SnackBarBehavior.floating, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(15), - topRight: Radius.circular(15), - ), - ), ), ); - if (widget.source == - 'VisitorNotFoundComponent') { - Navigator.pop(context); - } - }); - } else { - return DialogUtil.error( - context, - PhpGroup.postScheduleVisitorCall - .errorMsg( - _model.scheduleVisitor?.jsonBody) - .toString()); - } + }, + ); + }); + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + _model.dropDownValueController?.reset(); + _model.uploadedLocalFile = FFUploadedFile( + bytes: Uint8List.fromList([])); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + width: MediaQuery.of(context).size.width, + behavior: SnackBarBehavior.floating, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + ), + ); + if (widget.source == + 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); } else { - DialogUtil.error( + return DialogUtil.error( context, - FFLocalizations.of(context).getVariableText( - ptText: - 'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.', - enText: - 'Visitor already registered. Check if the document was filled in correctly.', - )); + PhpGroup.postScheduleVisitorCall.errorMsg( + _model + .scheduleVisitor?.jsonBody) == + null + ? FFLocalizations.of(context) + .getVariableText( + ptText: + 'Erro ao se conectar com o servidor', + enText: 'Error connecting to server', + ) + : PhpGroup.postScheduleVisitorCall + .errorMsg( + _model.scheduleVisitor?.jsonBody) + .toString()); } } : null, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 3ce328e6..27af1e4c 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -13,11 +13,11 @@ import 'package:intl/intl.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { - final _visitHistoryManager = StreamRequestManager(); - Stream visitHistory({ + final _visitHistoryManager = FutureRequestManager(); + Future visitHistory({ String? uniqueQueryKey, bool? overrideCache, - required Stream Function() requestFn, + required Future Function() requestFn, }) => _visitHistoryManager.performRequest( uniqueQueryKey: uniqueQueryKey, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 733a5bcc..61e1a120 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -10,6 +10,7 @@ import 'package:hub/actions/actions.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_action.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; @@ -1580,18 +1581,25 @@ Widget scheduleVisit( child: SizedBox( // width: MediaQuery.of(context).size.width, // height: MediaQuery.of(context).size.height * 0.7, - child: VisitDetailsModalTemplateComponentWidget( - visitStartDateStr: _model.textController1.text, - visitEndDateStr: _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: - _model.switchValue == true ? 'Sim' : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, + // child: VisitDetailsModalTemplateComponentWidget( + // visitStartDateStr: _model.textController1.text, + // visitEndDateStr: _model.textController2.text, + // visitReasonStr: _model.dropDownValue1, + // visitLevelStr: _model.dropDownValue2, + // visitTempStr: + // _model.switchValue == true ? 'Sim' : 'Não', + // visitObsStr: _model.textController3.text, + // visitorStrList: _model.visitorStrList, + // visitorJsonList: _model.visitorJsonList, + // updateToggleIdx: () async {}, + // repeatVisitSchedule: () async {}, + // ), + child: VisitRequestTemplateComponentWidget( + buttons: [], + imageHashMap: {}, + labelsHashMap: {}, + statusHashMap: [], + onTapCardItemAction: () async {}, ), ), ), diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index 4cb01778..46081da0 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -11,7 +11,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; -import 'package:provider/provider.dart'; class VisitHistoryWidget extends StatefulWidget { VisitHistoryWidget({ @@ -23,153 +22,153 @@ class VisitHistoryWidget extends StatefulWidget { } class _VisitHistoryWidgetState extends State { + late Future visitFuture; + var pageNumber = 1; + @override - Widget build(BuildContext context) { - var response = ScheduleCompleteVisitPageModel().visitHistory( + void initState() { + super.initState(); + // Inicialização inicial + visitFuture = ScheduleCompleteVisitPageModel().visitHistory( requestFn: () => PhpGroup.getVisitsCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, cliID: FFAppState().cliUUID, atividade: 'getVisitas', pageSize: 100, - pageNumber: 1, - ), - ); - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - // child: Consumer( - child: StreamBuilder( - stream: response, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, - ), - ), - ); - } else if (snapshot.hasError) { - return Center(child: Text('Error: ${snapshot.error}')); - } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { - return const Center(child: Text('No visits found')); - } - var wrapGetVisitsResponse = snapshot.data!; - var visitaWrap = PhpGroup.getVisitsCall - .visitasList(wrapGetVisitsResponse.jsonBody) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - return CardItemTemplateComponentWidget( - imageHashMap: { - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }, - labelsHashMap: { - 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', - 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', - 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', - }, - statusHashMap: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).warning, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.finished) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Finalizado', - enText: 'Finished', - ): FlutterFlowTheme.of(context).success, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.canceled) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ): FlutterFlowTheme.of(context).error, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }, - if (getStatus(visitaWrapItem['VAW_STATUS']) == - status.inactive) - { - FFLocalizations.of(context).getVariableText( - ptText: 'Inactive', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).error, - }, - ], - onTapCardItemAction: () async { - await showDialog( - // isScrollControlled: true, - // isDismissible: true, - // backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - - builder: (context) { - return Dialog( - alignment: Alignment.center, - child: buildDetails( - visitaWrapItem, - context, - changeStatusAction, - ), - ); - }, - ).whenComplete(() async { - final newResponseStream = - ScheduleCompleteVisitPageModel().visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - pageSize: 100, - pageNumber: 1, - ), - ); - newResponseStream.listen((newResponse) { - if (mounted) { - safeSetState(() { - response = newResponse.jsonBody; - }); - } else {} - }).onError((err) {}); - }).catchError((err, stack) {}); - }, - ); - }, - ); - }, + pageNumber: pageNumber, ), ); } + + void updateVisitFuture() { + // Atualização do valor da variável late + setState(() { + visitFuture = ScheduleCompleteVisitPageModel().visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + pageSize: 100, + pageNumber: pageNumber, + ), + ); + }); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: visitFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), + ), + ); + } else if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { + return Center( + child: Text(FFLocalizations.of(context).getVariableText( + ptText: 'Nenhum visitante foi encontrado', + enText: 'No visitors found', + ))); + } + + var wrapGetVisitsResponse = snapshot.data!; + var visitaWrap = PhpGroup.getVisitsCall + .visitasList(wrapGetVisitsResponse.jsonBody) + ?.toList() ?? + []; + + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + return CardItemTemplateComponentWidget( + imageHashMap: { + 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', + 'value': 'E', + }, + labelsHashMap: { + 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', + 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', + 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '', + }, + statusHashMap: [ + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active', + ): FlutterFlowTheme.of(context).warning, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.finished) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished', + ): FlutterFlowTheme.of(context).success, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.canceled) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked', + ): FlutterFlowTheme.of(context).error, + }, + if (getStatus(visitaWrapItem['VAW_STATUS']) == status.inactive) + { + FFLocalizations.of(context).getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).error, + }, + ], + onTapCardItemAction: () async { + await showDialog( + useSafeArea: true, + context: context, + builder: (context) { + return Dialog( + alignment: Alignment.center, + child: buildDetails( + visitaWrapItem, + context, + changeStatusAction, + ), + ); + }, + ).whenComplete(() { + log('Dialog closed'); + updateVisitFuture(); + }).catchError((err, stack) {}); + }, + ); + }, + ); + }, + ); + } } From 0f84ee89238234e2eea124043a6d9ebb3f24bce4 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 10:57:05 -0300 Subject: [PATCH 50/72] fix modal in register visit --- .../pushNotificationService.dart | 6 +- .../card_item_template_component_widget.dart | 7 +- .../details_component_action.dart | 8 +- .../details_component_widget.dart | 7 +- .../acess_history_page_widget.dart | 13 +- .../liberation_history_widget.dart | 13 +- .../schedule_complete_visit_page_model.dart | 25 ++++ .../schedule_complete_visit_page_widget.dart | 111 +++++++++++++++++- .../visit_history_page_widget.dart | 6 +- 9 files changed, 152 insertions(+), 44 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 98f023ec..09751698 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -587,10 +587,8 @@ class NotificationHandler { ptText: 'Mensagem', ): message['mensagem'], }), - imageHashMap: Map.from({ - 'key': message['documento'], - 'value': 'E', - }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${message['documento'] ?? ''}&tipo=E', statusHashMap: [ { FFLocalizations.of(context).getVariableText( diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 1b503c1e..59311bc9 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -17,13 +17,13 @@ class CardItemTemplateComponentWidget extends StatefulWidget { super.key, required this.labelsHashMap, required this.statusHashMap, - required this.imageHashMap, + required this.imagePath, required this.onTapCardItemAction, }); final Map? labelsHashMap; final List?> statusHashMap; - final Map imageHashMap; + final String? imagePath; final Future Function()? onTapCardItemAction; @override @@ -241,8 +241,7 @@ class _CardItemTemplateComponentWidgetState child: CachedNetworkImage( fadeInDuration: const Duration(milliseconds: 500), fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + imageUrl: widget.imagePath ?? '', fit: BoxFit.cover, ), ), diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index a1250742..eaec3e3d 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -123,10 +123,8 @@ URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${vi 'Inicio': visitaWrapItem['VAW_DTINICIO'] ?? '', 'Fim': visitaWrapItem['VAW_DTFIM'] ?? '', }), - imageHashMap: Map.from({ - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', statusHashMap: [ if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) Map.from({ @@ -168,7 +166,7 @@ URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${vi FFLocalizations.of(context).getVariableText( ptText: 'Inativo', enText: 'Inactive', - ): FlutterFlowTheme.of(context).error, + ): FlutterFlowTheme.of(context).warning, }), ], ); diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 4dc13176..ec11007b 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -16,14 +16,14 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget { Key? key, required this.labelsHashMap, required this.statusHashMap, - required this.imageHashMap, + required this.imagePath, this.onTapCardItemAction, required this.buttons, }); final Map labelsHashMap; final List?> statusHashMap; - final Map imageHashMap; + final String? imagePath; final Future Function()? onTapCardItemAction; final List buttons; @@ -111,8 +111,7 @@ class _VisitRequestTemplateComponentWidgetState child: CachedNetworkImage( fadeInDuration: const Duration(milliseconds: 100), fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', + imageUrl: widget.imagePath ?? '', fit: BoxFit.cover, ), ), diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index 48a4ae87..466d031e 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -292,10 +292,8 @@ class _AcessHistoryPageWidgetState extends State { Widget _accessHistoryCardMoleculeWidget( BuildContext context, dynamic accessHistoryItem) { return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': accessHistoryItem['PES_ID'] ?? '', - 'value': accessHistoryItem['PES_TIPO'] ?? '', - }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}', labelsHashMap: Map.from({ 'Nome:': accessHistoryItem['PES_NOME'] ?? '', 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', @@ -346,10 +344,3 @@ class _AcessHistoryPageWidgetState extends State { onTapCardItemAction: () async {}); } } - -String imageUrlAtomWidget(String document, String type) { - return valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", - "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", - ); -} diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 72c0dcf2..9ad1dfcf 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -298,10 +298,8 @@ Widget liberationDynamicListView( Widget liberationHistoryItemCard( BuildContext context, dynamic liberationHistoryItem) { return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${liberationHistoryItem['VTE_ID'] ?? ''}&tipo=E', labelsHashMap: Map.from({ 'Nome:': liberationHistoryItem['VTE_NOME'], 'Data:': liberationHistoryItem['NOT_DTENVIO'], @@ -567,10 +565,9 @@ Widget liberationHistoryItemCard( ): FlutterFlowTheme.of(context).warning, }) ], - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${liberationHistoryItem['VTE_ID'] ?? ''}&tipo=E', + // changeStatusAction: answersRequest, // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], ), diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 27af1e4c..aa896f5d 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -30,6 +30,31 @@ class ScheduleCompleteVisitPageModel /// Local state fields for this page. + String convertDateFormat(String dateStr) { + try { + // Formato original + DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + // Novo formato + DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); + + // Validate the input string format + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { + return 'Invalid date format'; + } + + // Converte a string para DateTime + DateTime dateTime = originalFormat.parse(dateStr); + + // Converte DateTime para a nova string formatada + String formattedDate = newFormat.format(dateTime); + return formattedDate; + } catch (e) { + // Handle the exception by returning an error message or a default value + return 'Invalid date format'; + } + } + List visitorJsonList = []; void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 61e1a120..438bffa5 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -24,6 +24,7 @@ import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; import 'package:provider/provider.dart'; class ScheduleCompleteVisitPageWidget extends StatefulWidget { @@ -1568,6 +1569,8 @@ Widget scheduleVisit( ), onPressed: _model.isValid() ? () async { + log(_model.dropDownValue1.toString()); + await showDialog( context: context, builder: (context) { @@ -1595,10 +1598,110 @@ Widget scheduleVisit( // repeatVisitSchedule: () async {}, // ), child: VisitRequestTemplateComponentWidget( - buttons: [], - imageHashMap: {}, - labelsHashMap: {}, - statusHashMap: [], + buttons: [ + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showAlertDialog( + context, + FFLocalizations.of(context) + .getVariableText( + ptText: 'Ativar Visita', + enText: 'Activate Visit', + ), + FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você tem certeza que deseja ativar essa visita?', + enText: + 'Are you sure you want to activate this visit?', + ), () async { + await PhpGroup.postScheduleVisitCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + atividade: 'putVisita', + devDesc: _model.textController3.text, + idVisitante: _model.visitorStrList, + dtInicio: _model.convertDateFormat( + _model.textController1.text ?? ''), + dtFim: _model.convertDateFormat( + _model.textController2.text ?? ''), + unica: _model.switchValue == true + ? 'Sim' + : 'Não', + idMotivo: extractIdToStr( + _model.dropDownValue1!), + idNAC: extractIdToStr( + _model.dropDownValue2!), + obs: _model.textController3.text, + cliID: FFAppState().cliUUID, + ) + .catchError((e) async { + await DialogUtil.errorDefault(context); + }).then((value) async { + if (PhpGroup.postScheduleVisitCall + .error( + (value.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + Navigator.pop(context); + showSnackbar( + context, + FFLocalizations.of(context) + .getVariableText( + enText: + 'Success in scheduling visit', + ptText: + 'Succeso ao agendar a visita', + ), + false, + ); + } else { + await DialogUtil.errorDefault( + context); + Navigator.pop(context); + Navigator.pop(context); + } + }); + + setState(() {}); + }); + }, + ), + ], + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${_model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', + labelsHashMap: { + 'Nome': _model.visitorJsonList[0]['VTE_NOME'], + 'Start': _model.textController1.text, + 'End': _model.textController2.text ?? '', + 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)') + .firstMatch( + _model.dropDownValue1.toString()) + ?.group(1) + .toString()) ?? + '', + 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)') + .firstMatch( + _model.dropDownValue2.toString()) + ?.group(1) + .toString()) ?? + '', + 'Single Visit': + _model.switchValue == true ? 'Sim' : 'Não', + if (_model.textController3.text.isNotEmpty) + 'Observation': _model.textController3.text, + }, + statusHashMap: [ + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).warning, + }), + ], onTapCardItemAction: () async {}, ), ), diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index 46081da0..cfc9670c 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -93,10 +93,8 @@ class _VisitHistoryWidgetState extends State { itemBuilder: (context, index) { final visitaWrapItem = visitaWrap[index]; return CardItemTemplateComponentWidget( - imageHashMap: { - 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '', - 'value': 'E', - }, + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', labelsHashMap: { 'Nome:': visitaWrapItem['VTE_NOME'] ?? '', 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '', From 2e337e1e265360c462c82239f03b0ee33a107350 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 11:19:43 -0300 Subject: [PATCH 51/72] WIP --- .../details_component_widget.dart | 66 +++++++-------- .../schedule_complete_visit_page_widget.dart | 83 +++++++++---------- 2 files changed, 66 insertions(+), 83 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index ec11007b..d31d6f9e 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -27,13 +27,6 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget { final Future Function()? onTapCardItemAction; final List buttons; - // final Future Function( - // BuildContext context, - // int idDestino, - // int idVisita, - // String AccessKey, - // )? changeStatusAction; - @override State createState() => _VisitRequestTemplateComponentWidgetState(); @@ -75,24 +68,13 @@ class _VisitRequestTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - // bool isLoaded = false; - // final pending = FFLocalizations.of(context).getVariableText( - // enText: 'Pending', - // ptText: 'Pendente', - // ); - // final active = FFLocalizations.of(context).getVariableText( - // enText: 'Ativo', - // ptText: 'Ativo', - // ); - // final canceled = FFLocalizations.of(context).getVariableText( - // enText: 'Canceled', - // ptText: 'Cancelado', - // ); - return LayoutBuilder( builder: (context, constraints) { + final maxWidth = constraints.maxWidth; + final maxHeight = constraints.maxHeight; + return Container( - width: constraints.maxWidth, + width: maxWidth, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.all(Radius.circular(25.0)), @@ -102,8 +84,8 @@ class _VisitRequestTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: 150.0, - height: 150.0, + width: maxWidth * 0.3, + height: maxWidth * 0.3, clipBehavior: Clip.antiAlias, decoration: const BoxDecoration( shape: BoxShape.circle, @@ -121,7 +103,9 @@ class _VisitRequestTemplateComponentWidgetState .map((MapEntry item) { return Expanded( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), + padding: EdgeInsets.symmetric( + horizontal: maxWidth * 0.05, + ), child: TextFormField( // controller: _model.textControllerStatus, // focusNode: _model.textFieldFocusNodeStatus, @@ -148,9 +132,11 @@ class _VisitRequestTemplateComponentWidgetState fontWeight: FontWeight.bold, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .labelMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -159,9 +145,11 @@ class _VisitRequestTemplateComponentWidgetState .labelMediumFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .labelMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), ), focusedBorder: InputBorder.none, errorBorder: InputBorder.none, @@ -179,8 +167,8 @@ class _VisitRequestTemplateComponentWidgetState color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + FlutterFlowTheme.of(context).bodyMediumFamily, + ), ), textAlign: TextAlign.start, maxLines: null, @@ -196,14 +184,16 @@ class _VisitRequestTemplateComponentWidgetState ListView.builder( shrinkWrap: true, itemCount: labelsLinkedHashMap.length, - physics: const NeverScrollableScrollPhysics(), + physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (context, index) { String key = labelsLinkedHashMap.keys.elementAt(index); String value = labelsLinkedHashMap[key]!; // return Text('key: $key, value: $value'); return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10.0, vertical: 3.0), + padding: EdgeInsets.symmetric( + horizontal: maxWidth * 0.02, + vertical: maxHeight * 0.01, + ), child: TextFormField( readOnly: true, initialValue: '$value', @@ -285,7 +275,9 @@ class _VisitRequestTemplateComponentWidgetState ), if (widget.buttons.isNotEmpty) Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), + padding: EdgeInsets.symmetric( + horizontal: maxWidth * 0.02, + ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: widget.buttons, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 438bffa5..f640d116 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -835,13 +835,9 @@ Widget scheduleVisit( itemBuilder: (context, visitorListViewIndex) { final visitorListViewItem = visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async {}, - onLongPress: () async {}, + return Padding( + padding: + const EdgeInsets.symmetric(horizontal: 30), child: Container( width: MediaQuery.of(context).size.width, height: 70.0, @@ -866,51 +862,45 @@ Widget scheduleVisit( fadeOutDuration: const Duration(milliseconds: 500), imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", fit: BoxFit.cover, ), ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - IconButton( - onPressed: () async { - _model - .removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - icon: const Icon(Icons.close)), - ], + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Text( + getJsonField(visitorListViewItem, + r'''$.VTE_NOME''') + .toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + overflow: TextOverflow.ellipsis, + ), ), ), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart(const SizedBox(width: 30.0)), + IconButton( + onPressed: () async { + _model.removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close), + ), + ], ), ), ); @@ -1602,6 +1592,7 @@ Widget scheduleVisit( FlutterFlowIconButton( icon: const Icon(Icons.done), onPressed: () async { + log('visitorStrList ${_model.visitorStrList}'); showAlertDialog( context, FFLocalizations.of(context) From 60a56db4461440eb2cc67f75cd029e8e17d73b85 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 11:29:43 -0300 Subject: [PATCH 52/72] WIP --- .../details_component_widget.dart | 392 +++++++++--------- 1 file changed, 190 insertions(+), 202 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index d31d6f9e..84086396 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -68,228 +68,216 @@ class _VisitRequestTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - return LayoutBuilder( - builder: (context, constraints) { - final maxWidth = constraints.maxWidth; - final maxHeight = constraints.maxHeight; - - return Container( - width: maxWidth, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: maxWidth * 0.3, - height: maxWidth * 0.3, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: widget.imagePath ?? '', - fit: BoxFit.cover, - ), + return SingleChildScrollView( + child: Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width, + maxHeight: MediaQuery.of(context).size.height, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.3, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), - Row( - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries - .map((MapEntry item) { - return Expanded( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: maxWidth * 0.05, - ), - child: TextFormField( - // controller: _model.textControllerStatus, - // focusNode: _model.textFieldFocusNodeStatus, - autofocus: false, - canRequestFocus: false, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: item.value, - ), - ), - filled: true, - fillColor: item.value, - labelText: item.key, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - fontWeight: FontWeight.bold, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily, - ), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily, - ), - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).info, + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: widget.imagePath ?? '', + fit: BoxFit.cover, + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * 0.05, + ), + child: TextFormField( + // controller: _model.textControllerStatus, + // focusNode: _model.textFieldFocusNodeStatus, + autofocus: false, + canRequestFocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: item.value, ), ), - style: FlutterFlowTheme.of(context) - .bodyMedium + filled: true, + fillColor: item.value, + labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, + fontWeight: FontWeight.bold, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily, + FlutterFlowTheme.of(context) + .labelMediumFamily, ), ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).info, + ), ), - ), - ); - }).toList(); - }).toList(), - ), - ListView.builder( - shrinkWrap: true, - itemCount: labelsLinkedHashMap.length, - physics: const AlwaysScrollableScrollPhysics(), - itemBuilder: (context, index) { - String key = labelsLinkedHashMap.keys.elementAt(index); - String value = labelsLinkedHashMap[key]!; - // return Text('key: $key, value: $value'); - return Padding( - padding: EdgeInsets.symmetric( - horizontal: maxWidth * 0.02, - vertical: maxHeight * 0.01, - ), - child: TextFormField( - readOnly: true, - initialValue: '$value', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily, - ), - ), - decoration: InputDecoration( - labelText: key, - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily, ), ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily, - ), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - errorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), ), ), ); - }, - ), - if (widget.buttons.isNotEmpty) - Padding( + }).toList(); + }).toList(), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + ListView.builder( + shrinkWrap: true, + itemCount: labelsLinkedHashMap.length, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String key = labelsLinkedHashMap.keys.elementAt(index); + String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + return Padding( padding: EdgeInsets.symmetric( - horizontal: maxWidth * 0.02, + horizontal: MediaQuery.of(context).size.width * 0.02, + vertical: MediaQuery.of(context).size.height * 0.01, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons, + child: TextFormField( + readOnly: true, + initialValue: '$value', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily, + ), + ), + decoration: InputDecoration( + labelText: key, + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, + ), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + ), ), - ), - ] - .divide(const Flexible(child: SizedBox(height: 20.0))) - .addToEnd(const Flexible(child: SizedBox(height: 20.0))) - .addToStart(const Flexible(child: SizedBox(height: 20.0))), - ), - ); - }, + ); + }, + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + if (widget.buttons.isNotEmpty) + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons, + ), + ], + ), + ), ); } } From 72f44dd41b61c4890ef9050f4c3112bf7143ea80 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 12:59:03 -0300 Subject: [PATCH 53/72] WIP --- .../details_component/details_component_widget.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 84086396..0c0b704c 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -271,10 +271,12 @@ class _VisitRequestTemplateComponentWidgetState ), SizedBox(height: MediaQuery.of(context).size.height * 0.02), if (widget.buttons.isNotEmpty) - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons, - ), + const SizedBox( + height: 16), // Adicione este SizedBox com a altura desejada + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons, + ), ], ), ), From 711b027890dd75fc1686176fbd429926c31d7404 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 13:12:24 -0300 Subject: [PATCH 54/72] WIP --- .../details_component_widget.dart | 141 +++++++++--------- 1 file changed, 67 insertions(+), 74 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 0c0b704c..6e91de1b 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -96,7 +96,7 @@ class _VisitRequestTemplateComponentWidgetState fit: BoxFit.cover, ), ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), + SizedBox(height: MediaQuery.of(context).size.height * 0.03), Row( children: statusLinkedHashMap.expand((linkedHashMap) { return linkedHashMap.entries @@ -177,7 +177,7 @@ class _VisitRequestTemplateComponentWidgetState }).toList(); }).toList(), ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), + SizedBox(height: MediaQuery.of(context).size.height * 0.03), ListView.builder( shrinkWrap: true, itemCount: labelsLinkedHashMap.length, @@ -186,83 +186,77 @@ class _VisitRequestTemplateComponentWidgetState String key = labelsLinkedHashMap.keys.elementAt(index); String value = labelsLinkedHashMap[key]!; // return Text('key: $key, value: $value'); - return Padding( - padding: EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * 0.02, - vertical: MediaQuery.of(context).size.height * 0.01, - ), - child: TextFormField( - readOnly: true, - initialValue: '$value', - style: FlutterFlowTheme.of(context).bodyMedium.override( + return TextFormField( + readOnly: true, + initialValue: '$value', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily, + ), + ), + decoration: InputDecoration( + labelText: key, + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily, + FlutterFlowTheme.of(context).labelMediumFamily, ), ), - decoration: InputDecoration( - labelText: key, - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - ), + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily, - ), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), - errorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), - focusedErrorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), ), @@ -270,13 +264,12 @@ class _VisitRequestTemplateComponentWidgetState }, ), SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if (widget.buttons.isNotEmpty) - const SizedBox( - height: 16), // Adicione este SizedBox com a altura desejada - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons, - ), + if (widget.buttons + .isNotEmpty) // Adicione este SizedBox com a altura desejada + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons, + ), ], ), ), From c1f76c4be3f32cf6bcfacbfbffc81dbe5bdfcaa3 Mon Sep 17 00:00:00 2001 From: jantunesmessias Date: Fri, 9 Aug 2024 13:19:47 -0300 Subject: [PATCH 55/72] =?UTF-8?q?=CB=9CWIP=CB=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../details_component_widget.dart | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 6e91de1b..13eae7e5 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -68,20 +68,22 @@ class _VisitRequestTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - return SingleChildScrollView( - child: Container( - constraints: BoxConstraints( - maxWidth: MediaQuery.of(context).size.width, - maxHeight: MediaQuery.of(context).size.height, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), + return Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width, + maxHeight: MediaQuery.of(context).size.height, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: SingleChildScrollView( child: Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Container( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3, From ccc4d4c7173394a44d60db7b35686e948e9590eb Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 15:11:50 -0300 Subject: [PATCH 56/72] fix: pagination in registerCompleteVisit --- .../details_component_widget.dart | 1 - .../visit_history_page_widget.dart | 97 +++++++++++++------ 2 files changed, 65 insertions(+), 33 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 13eae7e5..43e440c0 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -83,7 +83,6 @@ class _VisitRequestTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox(height: MediaQuery.of(context).size.height * 0.02), - Container( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3, diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index cfc9670c..fc5a818e 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -22,47 +22,59 @@ class VisitHistoryWidget extends StatefulWidget { } class _VisitHistoryWidgetState extends State { - late Future visitFuture; + List visitaWrap = []; var pageNumber = 1; + late Future visitFuture; @override void initState() { super.initState(); - // Inicialização inicial - visitFuture = ScheduleCompleteVisitPageModel().visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - pageSize: 100, - pageNumber: pageNumber, - ), - ); + visitFuture = _fetchVisits(); } - void updateVisitFuture() { - // Atualização do valor da variável late - setState(() { - visitFuture = ScheduleCompleteVisitPageModel().visitHistory( + Future _fetchVisits() async { + try { + var response = await ScheduleCompleteVisitPageModel().visitHistory( requestFn: () => PhpGroup.getVisitsCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, cliID: FFAppState().cliUUID, atividade: 'getVisitas', - pageSize: 100, + pageSize: 10, pageNumber: pageNumber, ), ); - }); + + log('API response: ${response.jsonBody}'); + + var newVisits = response.jsonBody['visitas'] + as List?; // Ajuste conforme a estrutura da resposta + if (newVisits != null && newVisits.isNotEmpty) { + setState(() { + visitaWrap.addAll(newVisits); + }); + return response; + } else { + log('No new visits found'); + return null; + } + } catch (err) { + log('Erro ao carregar mais visitas: $err'); + } + } + + void _loadMoreVisits() { + pageNumber++; + visitFuture = _fetchVisits(); } @override Widget build(BuildContext context) { - return FutureBuilder( + return FutureBuilder( future: visitFuture, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { + if (snapshot.connectionState == ConnectionState.waiting && + visitaWrap.isEmpty) { return Center( child: CircularProgressIndicator( valueColor: AlwaysStoppedAnimation( @@ -72,26 +84,38 @@ class _VisitHistoryWidgetState extends State { ); } else if (snapshot.hasError) { return Center(child: Text('Error: ${snapshot.error}')); - } else if (!snapshot.hasData || snapshot.data!.jsonBody == null) { + } else if (visitaWrap.isEmpty) { return Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: 'Nenhum visitante foi encontrado', - enText: 'No visitors found', - ))); + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Nenhum visitante foi encontrado', + enText: 'No visitors found', + ), + ), + ); } - var wrapGetVisitsResponse = snapshot.data!; - var visitaWrap = PhpGroup.getVisitsCall - .visitasList(wrapGetVisitsResponse.jsonBody) - ?.toList() ?? - []; + log('[A] - ${visitaWrap.length.toString()}'); return ListView.builder( - itemCount: visitaWrap.length, + itemCount: visitaWrap.length + 1, shrinkWrap: true, physics: const BouncingScrollPhysics(), itemBuilder: (context, index) { + if (index == visitaWrap.length) { + _loadMoreVisits(); + return Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), + ), + ); + } + final visitaWrapItem = visitaWrap[index]; + log('[B] - ${visitaWrap.length.toString()}'); + return CardItemTemplateComponentWidget( imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', @@ -160,7 +184,16 @@ class _VisitHistoryWidgetState extends State { }, ).whenComplete(() { log('Dialog closed'); - updateVisitFuture(); + // updateVisitFuture(); + _fetchVisits().then((response) { + safeSetState(() { + visitaWrap = PhpGroup.getVisitsCall + .visitasList(response!.jsonBody) + ?.toList() ?? + []; + visitFuture = Future.value(response); + }); + }); }).catchError((err, stack) {}); }, ); From 30b35685415e6189cbf69dcc832ee2a0ad563dbf Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 16:18:36 -0300 Subject: [PATCH 57/72] WIP --- .../details_component_action.dart | 17 ++++++++++++++++- .../details_component_widget.dart | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index eaec3e3d..5634c5a2 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -80,7 +80,11 @@ Widget buildDetails( ), if (getStatus(visitaWrapItem['VAW_STATUS']) != status.active) // RECALL ACTION - FlutterFlowIconButton( + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Reagendar', + enText: 'Reschedule', + ), icon: const Icon(Icons.refresh), onPressed: () async { Navigator.pop(context); @@ -100,6 +104,17 @@ Widget buildDetails( }.withoutNulls, ); }, + options: FFButtonOptions( + width: 130, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + elevation: 0, + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), ), if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // SHARE ACTION diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 43e440c0..aaff0fcb 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -271,6 +271,7 @@ class _VisitRequestTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: widget.buttons, ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), ], ), ), From 13b3c8f8cab27fb97f102c2d7b57c54a66fee92f Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 9 Aug 2024 16:30:28 -0300 Subject: [PATCH 58/72] WIP --- .../details_component/details_component_action.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 5634c5a2..3e3b07d7 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -109,6 +109,9 @@ Widget buildDetails( height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, From 092d122c3b9c5c522190d26fe2a9baaf74e0c4b3 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 13:59:10 -0300 Subject: [PATCH 59/72] WIP --- .../visitor_not_found_component_widget.dart | 31 ++-- ...iter_vistor_template_component_widget.dart | 10 +- ...earch_modal_template_component_widget.dart | 153 +++++++++++------- pubspec.lock | 24 +++ pubspec.yaml | 1 + 5 files changed, 143 insertions(+), 76 deletions(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 9ffcdc37..eb7192e2 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; @@ -9,8 +11,9 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; class VisitorNotFoundComponentWidget extends StatefulWidget { - const VisitorNotFoundComponentWidget({super.key}); + const VisitorNotFoundComponentWidget({this.doc, Key? key}) : super(key: key); + final String? doc; @override State createState() => _VisitorNotFoundComponentWidgetState(); @@ -42,7 +45,7 @@ class _VisitorNotFoundComponentWidgetState @override Widget build(BuildContext context) { return Container( - width: MediaQuery.of(context).size.height * 0.5, + width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height * 0.4, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, @@ -54,7 +57,6 @@ class _VisitorNotFoundComponentWidgetState ), ), child: Column( - mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Align( @@ -113,12 +115,12 @@ class _VisitorNotFoundComponentWidgetState ), ), ), - Expanded( + Padding( + padding: const EdgeInsets.symmetric(vertical: 10), child: Align( alignment: const AlignmentDirectional(0.0, 1.0), child: FFButtonWidget( onPressed: () async { - Navigator.pop(context); await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -130,19 +132,20 @@ class _VisitorNotFoundComponentWidgetState return Padding( padding: MediaQuery.viewInsetsOf(context), child: SizedBox( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.9, - child: const RegisiterVistorTemplateComponentWidget( - source: 'VisitorNotFoundComponent', - )), + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + doc: _model.widget?.doc, + ), + ), ); }, - ).then((value) => safeSetState(() {})); + ).then((value) => Navigator.pop(context, value)); }, text: FFLocalizations.of(context) .getVariableText(enText: 'Add', ptText: 'Adicionar'), options: FFButtonOptions( - width: double.infinity, height: 30.0, padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), @@ -165,8 +168,8 @@ class _VisitorNotFoundComponentWidgetState borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(25.0), bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), ), ), ), diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 43bec841..4172d6bf 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -23,9 +23,10 @@ export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { final String source; + final String? doc; const RegisiterVistorTemplateComponentWidget( - {super.key, required this.source}); + {super.key, required this.source, this.doc}); @override State createState() => @@ -53,6 +54,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController1 ??= TextEditingController(); _model.textFieldFocusNode1 ??= FocusNode(); + log('doc: ${widget.doc}'); _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); _model.textController2?.addListener(_onTextChanged); @@ -62,6 +64,10 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController4 ??= TextEditingController(); _model.textFieldFocusNode4 ??= FocusNode(); + + WidgetsBinding.instance?.addPostFrameCallback((timeStamp) { + _model.textController2.text = widget.doc ?? ''; + }); } @override @@ -882,7 +888,7 @@ class _RegisiterVistorTemplateComponentWidgetState ); if (widget.source == 'VisitorNotFoundComponent') { - Navigator.pop(context); + Navigator.pop(context, true); } }); } else { diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 963676a9..2aef7208 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,3 +1,7 @@ +import 'dart:developer'; + +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:flutter/services.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; @@ -11,6 +15,7 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; import 'package:provider/provider.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { @@ -84,50 +89,7 @@ class _VisitorSearchModalTemplateComponentWidgetState controller: _model.textController, focusNode: _model.textFieldFocusNode, onFieldSubmitted: (_) async { - setState(() { - _model.textController?.text = _model.textController.text; - _model.textController?.selection = TextSelection.collapsed( - offset: _model.textController!.text.length); - }); - _model.getVisitorByDoc = - await PhpGroup.getVisitorByDocCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitante', - documento: _model.textController.text, - ); - - if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { - _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( - (_model.getVisitorByDoc?.jsonBody ?? ''), - )); - setState(() {}); - _model.addToDocs(_model.textController.text); - setState(() {}); - } else { - await showAdaptiveDialog( - useSafeArea: true, - context: context, - builder: (context) { - return Dialog( - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Container( - color: Colors.transparent, - // width: MediaQuery.of(context).size.height * 0.1, - // height: - // MediaQuery.of(context).size.height * 0.4, - child: const VisitorNotFoundComponentWidget()), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - + await addVisitor(context); setState(() {}); }, autofocus: false, @@ -146,9 +108,6 @@ class _VisitorSearchModalTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), ), - hintText: FFLocalizations.of(context).getText( - '8i1qszba' /* test */, - ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent1, @@ -212,6 +171,9 @@ class _VisitorSearchModalTemplateComponentWidgetState ), keyboardType: TextInputType.number, validator: _model.textControllerValidator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], ), ), if (_model.visitors.isNotEmpty && _model.visitors.length > 0) @@ -427,19 +389,24 @@ class _VisitorSearchModalTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getVariableText( - enText: 'Add', - ptText: 'Adicionar', - ), + onPressed: MediaQuery.of(context).viewInsets.bottom > 0 + ? () async { + await addVisitor(context); + + setState(() {}); + } + : () async { + await sendVisitors(context); + }, + text: MediaQuery.of(context).viewInsets.bottom > 0 + ? FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ) + : FFLocalizations.of(context).getVariableText( + enText: 'Submit', + ptText: 'Enviar', + ), options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.1, @@ -479,4 +446,70 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ); } + + Future sendVisitors(BuildContext context) async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + } + + Future addVisitor(BuildContext context) async { + setState(() { + _model.textController?.text = _model.textController.text; + _model.textController?.selection = + TextSelection.collapsed(offset: _model.textController!.text.length); + }); + + var connectivityResult = await (Connectivity().checkConnectivity()); + if (connectivityResult == ConnectivityResult.none) { + DialogUtil.error(context, 'Sem conexão com a internet'); + return; + } + + _model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: _model.textController.text, + ); + + if (PhpGroup.getVisitorByDocCall.vistanteId( + (_model.getVisitorByDoc?.jsonBody ?? ''), + ) != + '0') { + _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + (_model.getVisitorByDoc?.jsonBody ?? ''), + )); + setState(() {}); + _model.addToDocs(_model.textController.text); + setState(() {}); + } else { + await showAdaptiveDialog( + useSafeArea: true, + context: context, + builder: (context) { + return Dialog( + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Container( + color: Colors.transparent, + child: VisitorNotFoundComponentWidget( + doc: _model.textController.text, + )), + ), + ); + }, + ).then((value) => safeSetState(() { + log('value: $value'); + if (value != null) { + addVisitor(context); + } + })); + } + } } diff --git a/pubspec.lock b/pubspec.lock index db941ddb..ebe0cae9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -137,6 +137,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + connectivity_plus: + dependency: "direct main" + description: + name: connectivity_plus + sha256: "2056db5241f96cdc0126bd94459fc4cdc13876753768fc7a31c425e50a7177d0" + url: "https://pub.dev" + source: hosted + version: "6.0.5" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.dev" + source: hosted + version: "2.0.1" crop_your_image: dependency: "direct main" description: @@ -941,6 +957,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" octo_image: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 95aa0238..e654dd48 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -48,6 +48,7 @@ dependencies: flutter_cache_manager: 3.3.2 flutter_plugin_android_lifecycle: 2.0.20 share_plus: ^9.0.0 + connectivity_plus: ^6.0.5 flutter_secure_storage: 9.2.2 flutter_secure_storage_linux: 1.2.1 flutter_secure_storage_macos: 3.1.2 From ccde7eb25e5a2fa3d13065491fcd8689b1658f1c Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:11:56 -0300 Subject: [PATCH 60/72] WIP --- .../schedule_complete_visit_page_widget.dart | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index f640d116..19f47d0a 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -931,31 +931,19 @@ Widget scheduleVisit( ? FocusScope.of(context) .requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), - child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.7, - width: MediaQuery.of(context).size.width, - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr(docsParam!.toList()); + setState(() {}); + }, ), ); }, From 49df453082faf5e76c844cc5956ad732b58bd716 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:19:15 -0300 Subject: [PATCH 61/72] WIP --- ...earch_modal_template_component_widget.dart | 18 +-------- .../schedule_complete_visit_page_widget.dart | 38 ++++++++++++------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 2aef7208..0239cf0b 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,6 +1,5 @@ import 'dart:developer'; -import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/services.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; @@ -15,7 +14,6 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/shared/utils/dialog_util.dart'; import 'package:provider/provider.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { @@ -463,13 +461,6 @@ class _VisitorSearchModalTemplateComponentWidgetState _model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length); }); - - var connectivityResult = await (Connectivity().checkConnectivity()); - if (connectivityResult == ConnectivityResult.none) { - DialogUtil.error(context, 'Sem conexão com a internet'); - return; - } - _model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, @@ -494,13 +485,8 @@ class _VisitorSearchModalTemplateComponentWidgetState context: context, builder: (context) { return Dialog( - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Container( - color: Colors.transparent, - child: VisitorNotFoundComponentWidget( - doc: _model.textController.text, - )), + child: VisitorNotFoundComponentWidget( + doc: _model.textController.text, ), ); }, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 19f47d0a..f640d116 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -931,19 +931,31 @@ Widget scheduleVisit( ? FocusScope.of(context) .requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - _model.visitorJsonList = visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr(docsParam!.toList()); - setState(() {}); - }, + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), + ), ), ); }, From 240560e2eb1dae8287283e36ce2cf8b82bf0bd58 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:20:54 -0300 Subject: [PATCH 62/72] WIP --- ...visitor_search_modal_template_component_widget.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 0239cf0b..7e85e4a7 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -485,9 +485,13 @@ class _VisitorSearchModalTemplateComponentWidgetState context: context, builder: (context) { return Dialog( - child: VisitorNotFoundComponentWidget( - doc: _model.textController.text, - ), + child: Container( + color: Colors.transparent, + width: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.4, + child: VisitorNotFoundComponentWidget( + doc: _model.textController.text, + )), ); }, ).then((value) => safeSetState(() { From 3a6cbe57bc5da9fa5f60d2e27a8dfdea24055798 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:23:07 -0300 Subject: [PATCH 63/72] WIP --- .../visitor_not_found_component_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index eb7192e2..b56ce463 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -46,7 +46,7 @@ class _VisitorNotFoundComponentWidgetState Widget build(BuildContext context) { return Container( width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.4, + height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( From 1b06219bfa1a9307134bea48830e75d8e548cb26 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:25:42 -0300 Subject: [PATCH 64/72] WIP --- .../visitor_not_found_component_widget.dart | 244 +++++++++--------- 1 file changed, 125 insertions(+), 119 deletions(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index b56ce463..3f5b04da 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -44,138 +44,144 @@ class _VisitorNotFoundComponentWidgetState @override Widget build(BuildContext context) { - return Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + return SingleChildScrollView( + child: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, ), - onPressed: () async { - Navigator.pop(context); - }, ), ), - ), - Icon( - Icons.notifications_none, - color: FlutterFlowTheme.of(context).accent1, - size: 72.0, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1p9mykbj' /* Usuário não encontrado */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), + Icon( + Icons.notifications_none, + color: FlutterFlowTheme.of(context).accent1, + size: 72.0, ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kt937sp6' /* O documento inserido não corre... */, + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '1p9mykbj' /* Usuário não encontrado */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: + FlutterFlowTheme.of(context).headlineMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontStyle: FontStyle.italic, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), ), - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 10), - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: true, - useSafeArea: true, - isDismissible: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: SizedBox( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.9, - child: RegisiterVistorTemplateComponentWidget( - source: 'VisitorNotFoundComponent', - doc: _model.widget?.doc, + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'kt937sp6' /* O documento inserido não corre... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontStyle: FontStyle.italic, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: true, + useSafeArea: true, + isDismissible: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + doc: _model.widget?.doc, + ), ), + ); + }, + ).then((value) => Navigator.pop(context, value)); + }, + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), + options: FFButtonOptions( + height: 30.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.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: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), ), - ); - }, - ).then((value) => Navigator.pop(context, value)); - }, - text: FFLocalizations.of(context) - .getVariableText(enText: 'Add', ptText: 'Adicionar'), - options: FFButtonOptions( - height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.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: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), ), ), ), ), - ), - ], + ], + ), ), ); } From 1d721389263a08e57b2e60dd3eca4d4280d196c7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 12 Aug 2024 14:43:58 -0300 Subject: [PATCH 65/72] WIP --- .../visitor_not_found_component_widget.dart | 4 ++-- ...visitor_search_modal_template_component_widget.dart | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 3f5b04da..f68f8317 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -46,8 +46,8 @@ class _VisitorNotFoundComponentWidgetState Widget build(BuildContext context) { return SingleChildScrollView( child: Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 7e85e4a7..0239cf0b 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -485,13 +485,9 @@ class _VisitorSearchModalTemplateComponentWidgetState context: context, builder: (context) { return Dialog( - child: Container( - color: Colors.transparent, - width: MediaQuery.of(context).size.height * 0.1, - height: MediaQuery.of(context).size.height * 0.4, - child: VisitorNotFoundComponentWidget( - doc: _model.textController.text, - )), + child: VisitorNotFoundComponentWidget( + doc: _model.textController.text, + ), ); }, ).then((value) => safeSetState(() { From 4d26e74ca1ba0e48f70d9a446684604e1b89426c Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 12 Aug 2024 17:28:18 -0300 Subject: [PATCH 66/72] =?UTF-8?q?fix:=20Pagina=C3=A7=C3=A3o=20da=20Tela=20?= =?UTF-8?q?de=20Mensagem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Podfile.lock | 7 + lib/backend/api_requests/api_manager.dart | 1 - .../message_history_page_widget.dart | 607 ++++++++++-------- 3 files changed, 334 insertions(+), 281 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0aa4fbd2..acfbf591 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,4 +1,7 @@ PODS: + - connectivity_plus (0.0.1): + - Flutter + - FlutterMacOS - device_info_plus (0.0.1): - Flutter - DKImagePickerController/Core (4.3.9): @@ -225,6 +228,7 @@ PODS: - Flutter DEPENDENCIES: + - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) @@ -271,6 +275,8 @@ SPEC REPOS: - SwiftyGif EXTERNAL SOURCES: + connectivity_plus: + :path: ".symlinks/plugins/connectivity_plus/darwin" device_info_plus: :path: ".symlinks/plugins/device_info_plus/ios" file_picker: @@ -313,6 +319,7 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: + connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 14784b1c..8c2cd6ea 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -411,7 +411,6 @@ class ApiManager { ApiCallOptions? options, http.Client? client, }) async { - log('makeApiCall -> $params.toString()'); final callOptions = options ?? ApiCallOptions( diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 81e48c79..6a4798b2 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -1,5 +1,3 @@ -// import 'dart:js_interop'; - import 'dart:developer'; import 'package:hub/app_state.dart'; @@ -14,6 +12,7 @@ import 'package:hub/pages/message_history_page/message_history_page_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:provider/provider.dart'; @@ -21,28 +20,52 @@ class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @override - State createState() => - _MessageHistoryPageWidgetState(); + State createState() => _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State - with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); - int currentPage = 0; - int totalPage = 0; + + late ScrollController _scrollController; + + int _pageNumber = 1; + final int _pageSize = 10; + bool _hasData = false; + bool _loading = false; + + String _destinyType = "P"; + + late Future _messageFuture; + List _messageWrap = []; @override void initState() { super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); - _model.tabBarController = TabController( - vsync: this, - length: 3, - initialIndex: 1, - )..addListener(() => setState(() {})); + _messageFuture = fetchMessage(); + + _scrollController = ScrollController()..addListener(() { + if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + _loadMore(); + } + }); + + _model.tabBarController = TabController(vsync: this, length: 3, initialIndex: 0)..addListener(() { + if (_model.tabBarController?.index == 0) { + _destinyType = "P"; + } else if (_model.tabBarController?.index == 1) { + _destinyType = "A"; + } else { + _destinyType = "T"; + } + + _pageNumber = 1; + _messageWrap = []; + _messageFuture = fetchMessage(); + }); _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); @@ -51,7 +74,7 @@ class _MessageHistoryPageWidgetState extends State @override void dispose() { _model.dispose(); - + _scrollController.dispose(); super.dispose(); } @@ -66,282 +89,306 @@ class _MessageHistoryPageWidgetState extends State return Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: buildAppBar(context), - body: buildBody(context, _model), + appBar: _appBar(context), + body: _body(context), ); } -} -PreferredSizeWidget buildAppBar(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Message History', - ptText: 'Histórico de Mensagens', - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} + Future fetchMessage() async { + try { + setState(() => _loading = true); -Widget buildBody(BuildContext context, MessageHistoryPageModel _model) { - return SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const Alignment(0.0, 0), - child: TabBar( - labelColor: FlutterFlowTheme.of(context).primaryText, - unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, - labelStyle: FlutterFlowTheme.of(context).titleMedium.override( - fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleMediumFamily), - ), - unselectedLabelStyle: const TextStyle(), - indicatorColor: FlutterFlowTheme.of(context).primary, - padding: const EdgeInsets.all(4.0), - tabs: [ - Tab( - text: FFLocalizations.of(context).getVariableText( - ptText: 'Pessoal', - enText: 'Personal', - ), - ), - Tab( - text: FFLocalizations.of(context).getVariableText( - enText: 'All', - ptText: 'Todos', - ), - ), - Tab( - text: FFLocalizations.of(context).getVariableText( - ptText: 'Global', - enText: 'Global', - ), - ), - ], - controller: _model.tabBarController, - onTap: (i) async { - [() async {}, () async {}][i](); - }, - ), + var response = await PhpGroup.getMessagesCall.call( + devUUID: FFAppState().devUUID.toString(), + userUUID: FFAppState().userUUID.toString(), + cliID: FFAppState().cliUUID.toString(), + atividade: 'getMensagens', + pageSize: _pageSize.toString(), + pageNumber: _pageNumber.toString(), + tipoDestino: _destinyType, + ); + + final List messages = response.jsonBody['mensagens'] ?? []; + + if (messages != null && messages.isNotEmpty) { + setState(() { + _messageWrap.addAll(messages); + _hasData = true; + _loading = false; + }); + + return response; + } + + _showNoMoreDataSnackBar(context); + + setState(() { + _hasData = false; + _loading = false; + }); + return null; + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Mensagems", e, s); + setState(() { + _hasData = false; + _loading = false; + }); + } + } + + void _loadMore() { + if (_hasData == true) { + _pageNumber++; + _messageFuture = fetchMessage(); + } + } + + PreferredSizeWidget _appBar(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - Expanded( - child: TabBarView(controller: _model.tabBarController, children: [ - buildListView(context, _model, 'P'), - buildListView(context, _model, 'A'), - buildListView(context, _model, 'T'), - ])), - ].addToStart(const SizedBox(height: 0)), - ), - ); -} + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Message History', + ptText: 'Histórico de Mensagens', + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); + } -Widget buildListView( - BuildContext context, MessageHistoryPageModel _model, String DestIndex) { - return Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: Future(() async { - var body = { - 'devUUID': FFAppState().devUUID.toString(), - 'userUUID': FFAppState().userUUID.toString(), - 'cliID': FFAppState().cliUUID.toString(), - 'atividade': 'getMensagens', - 'pageSize': '100', - 'pageNumber': '1', - 'tipoDestino': DestIndex.toString(), - }; - try { - var response = await PhpGroup.getMessagesCall.call( - devUUID: body['devUUID'], - userUUID: body['userUUID'], - cliID: body['cliID'], - atividade: body['atividade'], - pageSize: body['pageSize'], - pageNumber: body['pageNumber'], - tipoDestino: DestIndex, - ); - return response.jsonBody; - } catch (error, stack) { - LogUtil.requestAPIFailed('processRequest.php', jsonEncode(body), - 'Mensagens não Encontradas', error, stack); - return {'mensagens': [], 'total_rows': 0}; - } - }), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, + Widget _body(BuildContext context) { + return SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), ), - ), - ); - } - if (snapshot.hasError == true || - snapshot.data == null || - !snapshot.hasData || - snapshot.hasError) { - return const Center( - child: Text('Erro ao carregar mensagens'), - ); - } - final mensagens = snapshot.data!['mensagens']; - final totalRows = snapshot.data!['total_rows']; - if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { - return const Center( - child: Text('Nenhuma mensagem encontrada'), - ); - } - return ListView.builder( - itemCount: totalRows, - addAutomaticKeepAlives: false, - addRepaintBoundaries: true, - cacheExtent: 1000.0, - itemBuilder: (BuildContext context, int index) { - return buildListItem( - context, - snapshot.data!['mensagens'][index], - ); - }, - ); - }, - ), - ); -} - -Widget buildListItem(BuildContext context, dynamic jsonBody) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Card( - color: FlutterFlowTheme.of(context).primaryBackground, - child: Container( - // height: 100, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.language - : jsonBody['MSG_DESTINO_TP'] == 'P' - ? Icons.person - : Icons.home, - color: FlutterFlowTheme.of(context).primary, - size: 25, - ), - Expanded( - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 15, - color: FlutterFlowTheme.of(context).primary, - ), - overflow: TextOverflow.fade, - ), - ), - ].divide(const SizedBox(width: 10)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.only(left: 5), - child: Icon( - Icons.history, - color: FlutterFlowTheme.of(context).customColor6, - size: 15, - ), - ), - Expanded( - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 10, - color: - FlutterFlowTheme.of(context).customColor6, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ].divide(const SizedBox(width: 15)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.only(left: 5), - child: Icon( - Icons.message, - color: FlutterFlowTheme.of(context).customColor6, - size: 15, - ), - ), - Expanded( - child: Text( - jsonBody['MSG_TEXTO'].toString(), - ), - ), - ].divide(const SizedBox(width: 15)), - ), - ].divide(const SizedBox(height: 4)), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Pessoal', + enText: 'Personal', ), ), - ].divide( - const SizedBox(height: 8), + Tab( + text: FFLocalizations.of(context).getVariableText( + enText: 'All', + ptText: 'Todos', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Global', + enText: 'Global', + ), + ), + ], + controller: _model.tabBarController, + ), + ), + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma mensagem encontrada!", + enText: "No message found" + ) + ), + ) + ], + ), + ) + else if (_hasData == true || _pageNumber >= 1) + Expanded( + child: FutureBuilder( + future: _messageFuture, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _messageWrap.length, + itemBuilder: (context, index) { + final item = _messageWrap[index]; + return _item(context, item); + } + ); + }, + ), + ), + if (_hasData == true && _loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), + ), + ), + ) + ].addToStart(const SizedBox(height: 0)), + ), + ); + } + + void _showNoMoreDataSnackBar(BuildContext context) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + ), + duration: const Duration(seconds: 3), + backgroundColor: FlutterFlowTheme.of(context).primary, + ), + ); + } + + + Widget _item(BuildContext context, dynamic jsonBody) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + color: FlutterFlowTheme.of(context).primaryBackground, + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.language + : jsonBody['MSG_DESTINO_TP'] == 'P' + ? Icons.person + : Icons.home, + color: FlutterFlowTheme.of(context).primary, + size: 25, + ), + Expanded( + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ].divide(const SizedBox(width: 10)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.history, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: + FlutterFlowTheme.of(context).customColor6, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ].divide(const SizedBox(width: 15)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5), + child: Icon( + Icons.message, + color: FlutterFlowTheme.of(context).customColor6, + size: 15, + ), + ), + Expanded( + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + ].divide(const SizedBox(width: 15)), + ), + ].divide(const SizedBox(height: 4)), + ), + ), + ].divide( + const SizedBox(height: 8), + ), ), ), ), - ), - )); + )); + } + } + + From 6495138588b218669032e0dc04d640e1199901d1 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Tue, 13 Aug 2024 11:01:29 -0300 Subject: [PATCH 67/72] fix: changes --- .../pushNotificationService.dart | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 760ec742..357068be 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -125,10 +125,8 @@ class PushNotificationService { onDidReceiveNotificationResponse: (NotificationResponse response) async { if (response.payload != null) { try { - Map message = - validJsonFromString(response.payload!); - var data = - _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage + Map message = validJsonFromString(response.payload!); + var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage _handleNotificationClick(message, extra: data.value); } catch (e) {} } @@ -166,6 +164,7 @@ class PushNotificationService { void _listenToForegroundMessages(BuildContext context) { FirebaseMessaging.onMessage.listen((RemoteMessage message) { + log("Message Foregroud: ${message.data}"); _onMessage.add(message); _notificationDetails.add(message.toMap()['notification']); _showNotification(message); @@ -260,8 +259,7 @@ class PushNotificationService { priority: Priority.high, ); var iOSDetails = DarwinNotificationDetails(); - var generalNotificationDetails = - NotificationDetails(android: androidDetails, iOS: iOSDetails); + var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails); await _flutterLocalNotificationsPlugin.show( // DateTime.now().millisecondsSinceEpoch % (1 << 31), @@ -279,8 +277,7 @@ class PushNotificationService { case true: // Print the 'data' property // Handle the message data as needed - NotificationHandler().handleMessage(payload, _context.value, - extra: extra.isEmpty ? {} : extra); + NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra); // Access the 'data' property of 'RemoteMessage' case false: // Handle the message notification as needed @@ -288,19 +285,18 @@ class PushNotificationService { } } - static Future _firebaseMessagingBackgroundHandler( - RemoteMessage message) async {} + static Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { + log("Mensagem firebase: $message"); + } } class NotificationHandler { - void handleMessage(Map message, BuildContext context, - {Map extra = const {}}) { + void handleMessage(Map message, BuildContext context, {Map extra = const {}}) { message.forEach((key, value) {}); switch (message['click_action']) { case 'visit_request': _showVisitRequestDialog(message, context); - break; case '': break; @@ -308,6 +304,7 @@ class NotificationHandler { _showAcessNotificationModal(message, context); break; case 'mensagem': + log("Extra Handle Message: $extra"); _showMessageNotificationDialog(message, context, extra); break; case 'enroll_cond': @@ -355,13 +352,22 @@ class NotificationHandler { ); } - void _showMessageNotificationDialog(Map message, - BuildContext context, Map extra) { + void _showMessageNotificationDialog(Map message, BuildContext context, Map extra) { showDialog( useSafeArea: true, barrierDismissible: true, context: context, builder: (BuildContext context) { + String localId = ''; + try { + localId = jsonDecode(message['local'])['CLI_ID']; + } catch(e, s) { + localId = message['local']['CLI_ID'].toString(); + } + + log("Mensagem: $message"); + log("Extra: $extra"); + return GestureDetector( onTap: () => Navigator.of(context).pop(), child: SizedBox( @@ -375,7 +381,7 @@ class NotificationHandler { width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, child: MessageNotificationModalTemplateComponentWidget( - id: message['local']['CLI_ID'].toString(), + id: localId, from: message['remetente'].toString(), to: message['destinatario'].toString() == 'O' ? 'Morador' From d2cf5b425226c806da2c19b24763ab665b819456 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 13 Aug 2024 09:03:14 -0300 Subject: [PATCH 68/72] fix: Fix setState calls in message history page widget --- .../pushNotificationService.dart | 98 ++------ .../details_component_action.dart | 49 +++- ...earch_modal_template_component_widget.dart | 31 ++- .../liberation_history_widget.dart | 228 +++--------------- .../message_history_page_widget.dart | 104 ++++---- 5 files changed, 170 insertions(+), 340 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 09751698..537e780a 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -491,85 +491,25 @@ class NotificationHandler { FlutterFlowIconButton( icon: const Icon(Icons.close), onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja bloquear essa visita?', - enText: - 'Are you sure you want to block this visit?', - ), - ), - backgroundColor: - FlutterFlowTheme.of(context).primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - await answersRequest.call( - context, - message['referencia'].toString(), - 'B', - 'Mensagem', - message['idVisitante'].toString(), - ); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: - FlutterFlowTheme.of(context).primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], - ); - }); + showAlertDialog( + context, + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: 'Are you sure you want to block this visit?', + ), () async { + await answersRequest.call( + context, + message['referencia'].toString(), + 'B', + 'Mensagem', + message['idVisitante'].toString(), + ); + }); }, ), ], diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 3e3b07d7..21e7808a 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -1,4 +1,4 @@ -import 'dart:math'; +import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:hub/actions/actions.dart'; @@ -18,11 +18,16 @@ Widget buildDetails( BuildContext context, Future Function(BuildContext, int, int, String, String)? changeStatusAction) { + log('visitaWrapItem: ${visitaWrapItem.toString()}'); return VisitRequestTemplateComponentWidget( buttons: [ if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // REJECT ACTION - FlutterFlowIconButton( + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Cancelar', + enText: 'Cancel', + ), icon: const Icon(Icons.close), onPressed: () async { showAlertDialog( @@ -77,6 +82,20 @@ Widget buildDetails( }); }); }, + options: FFButtonOptions( + width: 130, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), ), if (getStatus(visitaWrapItem['VAW_STATUS']) != status.active) // RECALL ACTION @@ -89,9 +108,15 @@ Widget buildDetails( onPressed: () async { Navigator.pop(context); Navigator.pop(context); + context.pushNamed( 'scheduleCompleteVisitPage', queryParameters: { + 'dropdownValue1': visitaWrapItem['MOT_DESCRICAO'], + 'dropdownValue2': serializeParam( + visitaWrapItem['NAC_DESCRICAO'], + ParamType.String, + ), 'visitorStrList': serializeParam( visitaWrapItem['VTE_DOCUMENTO'], ParamType.String, @@ -121,7 +146,11 @@ Widget buildDetails( ), if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // SHARE ACTION - FlutterFlowIconButton( + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Reagendar', + enText: 'Reschedule', + ), icon: const Icon(Icons.share), onPressed: () async { Share.share(''' @@ -134,6 +163,20 @@ Olá, \*${visitaWrapItem['VTE_NOME']}\*! Você foi convidado para \*${visitaWrap URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']} '''); }, + options: FFButtonOptions( + width: 130, + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), ), ], labelsHashMap: Map.from({ diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 0239cf0b..b545ed9f 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -37,7 +37,7 @@ class _VisitorSearchModalTemplateComponentWidgetState late VisitorSearchModalTemplateComponentModel _model; @override - void setState(VoidCallback callback) { + safeSetState(VoidCallback callback) { super.setState(callback); _model.onUpdate(); } @@ -88,7 +88,7 @@ class _VisitorSearchModalTemplateComponentWidgetState focusNode: _model.textFieldFocusNode, onFieldSubmitted: (_) async { await addVisitor(context); - setState(() {}); + safeSetState(() {}); }, autofocus: false, textInputAction: TextInputAction.done, @@ -267,7 +267,7 @@ class _VisitorSearchModalTemplateComponentWidgetState // ), // ); // }, - // ).then((value) => safeSetState(() {})); + // ).then((value) => safeSetState(() {})); }, child: Container( width: 100.0, @@ -356,7 +356,7 @@ class _VisitorSearchModalTemplateComponentWidgetState onPressed: () async { _model.removeFromVisitors( visitorItem); - setState(() {}); + safeSetState(() {}); }, ), ], @@ -391,7 +391,7 @@ class _VisitorSearchModalTemplateComponentWidgetState ? () async { await addVisitor(context); - setState(() {}); + safeSetState(() {}); } : () async { await sendVisitors(context); @@ -437,7 +437,7 @@ class _VisitorSearchModalTemplateComponentWidgetState ], ), const SizedBox( - height: 10.0, + height: 20.0, ) ], ), @@ -456,7 +456,7 @@ class _VisitorSearchModalTemplateComponentWidgetState } Future addVisitor(BuildContext context) async { - setState(() { + safeSetState(() { _model.textController?.text = _model.textController.text; _model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length); @@ -470,15 +470,22 @@ class _VisitorSearchModalTemplateComponentWidgetState ); if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { + (_model.getVisitorByDoc?.jsonBody ?? ''), + ) != + '0' && + PhpGroup.getVisitorByDocCall + .error((_model.getVisitorByDoc?.jsonBody ?? '')) == + false && + PhpGroup.getVisitorByDocCall + .vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != + null) { + log('visitor found: ${PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? ''))}'); _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( (_model.getVisitorByDoc?.jsonBody ?? ''), )); - setState(() {}); + safeSetState(() {}); _model.addToDocs(_model.textController.text); - setState(() {}); + safeSetState(() {}); } else { await showAdaptiveDialog( useSafeArea: true, diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 9ad1dfcf..7389a2c8 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -53,7 +53,7 @@ class _LiberationHistoryWidgetState extends State { void onUpdate(BuildContext context) { _model.clearGetLiberationsCache(); - setState(() {}); + safeSetState(() {}); } @override @@ -338,20 +338,6 @@ Widget liberationHistoryItemCard( return Dialog( alignment: Alignment.center, child: VisitRequestTemplateComponentWidget( - // vteName: liberationHistoryItem['VTE_NOME'], - // vteReason: liberationHistoryItem['NOT_MOTIVO'], - // vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - // ? liberationHistoryItem['NOT_DTENVIO'] - // : liberationHistoryItem['NOT_DTRESPOSTA'], - // vawStatus: liberationHistoryItem['NOT_STATUS'], - // vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - // vteUUID: liberationHistoryItem['VTE_ID'], - // cliUUID: FFAppState().cliUUID, - // msgUUID: liberationHistoryItem['NOT_ID'], - // vawDestino: liberationHistoryItem['NOT_DESTINO'], - // vawUUID: liberationHistoryItem['NOT_ID'], - // vawName: liberationHistoryItem['NOT_NOME'], - // vawRef: liberationHistoryItem['NOT_ID'], labelsHashMap: Map.from({ 'Nome:': liberationHistoryItem['VTE_NOME'], 'Data:': liberationHistoryItem['NOT_DTENVIO'], @@ -364,182 +350,32 @@ Widget liberationHistoryItemCard( FlutterFlowIconButton( icon: const Icon(Icons.done), onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Aprovar Visita', - enText: 'Approve Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja aprovar essa visita?', - enText: - 'Are you sure you want to approve this visit?', - ), - ), - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - Navigator.pop(context); - Navigator.pop(context); - await answersRequest - .call( - context, - liberationHistoryItem['NOT_ID'] - .toString(), - 'L', - 'Mensagem', - liberationHistoryItem['VTE_ID'] - .toString(), - ) - .then((value) {}); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], - ); - }); - }, - ), - if (liberationHistoryItem['NOT_STATUS'] == 'S') - FlutterFlowIconButton( - icon: const Icon(Icons.close), - onPressed: () async { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', - ), - ), - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem certeza que deseja bloquear essa visita?', - enText: - 'Are you sure you want to block this visit?', - ), - ), - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - actions: [ - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'No', - ptText: 'Não', - ), - onPressed: () { - Navigator.pop(context); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10)), - ), - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'Yes', - ptText: 'Sim', - ), - onPressed: () async { - await answersRequest.call( - context, - liberationHistoryItem['NOT_ID'] - .toString(), - 'B', - 'Mensagem', - liberationHistoryItem['VTE_ID'] - .toString(), - ); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, - width: 1, - ), - borderRadius: BorderRadius.circular(10), - ), - ), - ], - ); - }); + Navigator.pop(context); + await answersRequest + .call( + context, + liberationHistoryItem['NOT_ID'].toString(), + 'L', + 'Mensagem', + liberationHistoryItem['VTE_ID'].toString(), + ) + .then((value) { + if (value) { + return showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Successfully resolved visit', + ptText: 'Visita resolvida com sucesso'), + false); + } else { + return showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error resolving visit', + ptText: 'Erro ao resolver visita'), + true); + } + }); }, ), ], @@ -567,9 +403,6 @@ Widget liberationHistoryItemCard( ], imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${liberationHistoryItem['VTE_ID'] ?? ''}&tipo=E', - - // changeStatusAction: answersRequest, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], ), ); }, @@ -580,7 +413,12 @@ Widget liberationHistoryItemCard( _pushNotificationService.onMessageReceived.listen((received) { if (received.data['click_action'] == 'cancel_request') { _pushNotificationService.dispose(); - snackbar(context, opt: true); + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Successfully resolved visit', + ptText: 'Visita resolvida com sucesso'), + false); context.pushReplacementNamed( 'liberationHistory', extra: { diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 6a4798b2..6bcc97b4 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -20,10 +20,12 @@ class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @override - State createState() => _MessageHistoryPageWidgetState(); + State createState() => + _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -47,25 +49,29 @@ class _MessageHistoryPageWidgetState extends State wit _messageFuture = fetchMessage(); - _scrollController = ScrollController()..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { - _loadMore(); - } - }); + _scrollController = ScrollController() + ..addListener(() { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { + _loadMore(); + } + }); - _model.tabBarController = TabController(vsync: this, length: 3, initialIndex: 0)..addListener(() { - if (_model.tabBarController?.index == 0) { - _destinyType = "P"; - } else if (_model.tabBarController?.index == 1) { - _destinyType = "A"; - } else { - _destinyType = "T"; - } + _model.tabBarController = + TabController(vsync: this, length: 3, initialIndex: 0) + ..addListener(() { + if (_model.tabBarController?.index == 0) { + _destinyType = "P"; + } else if (_model.tabBarController?.index == 1) { + _destinyType = "A"; + } else { + _destinyType = "T"; + } - _pageNumber = 1; - _messageWrap = []; - _messageFuture = fetchMessage(); - }); + _pageNumber = 1; + _messageWrap = []; + _messageFuture = fetchMessage(); + }); _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); @@ -80,7 +86,7 @@ class _MessageHistoryPageWidgetState extends State wit void onUpdate(BuildContext context) { _model.clearGetLiberationsCache(); - setState(() {}); + safeSetState(() {}); } @override @@ -129,7 +135,8 @@ class _MessageHistoryPageWidgetState extends State wit return null; } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Mensagems", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Mensagems", e, s); setState(() { _hasData = false; _loading = false; @@ -168,12 +175,12 @@ class _MessageHistoryPageWidgetState extends State wit ptText: 'Histórico de Mensagens', ), style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), ), actions: const [], centerTitle: true, @@ -193,12 +200,12 @@ class _MessageHistoryPageWidgetState extends State wit labelColor: FlutterFlowTheme.of(context).primaryText, unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, labelStyle: FlutterFlowTheme.of(context).titleMedium.override( - fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleMediumFamily), - ), + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), unselectedLabelStyle: const TextStyle(), indicatorColor: FlutterFlowTheme.of(context).primary, padding: const EdgeInsets.all(4.0), @@ -232,19 +239,16 @@ class _MessageHistoryPageWidgetState extends State wit mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text( - FFLocalizations.of(context).getVariableText( + child: Text(FFLocalizations.of(context).getVariableText( ptText: "Nenhuma mensagem encontrada!", - enText: "No message found" - ) - ), + enText: "No message found")), ) ], ), ) else if (_hasData == true || _pageNumber >= 1) Expanded( - child: FutureBuilder( + child: FutureBuilder( future: _messageFuture, builder: (context, snapshot) { return ListView.builder( @@ -255,8 +259,7 @@ class _MessageHistoryPageWidgetState extends State wit itemBuilder: (context, index) { final item = _messageWrap[index]; return _item(context, item); - } - ); + }); }, ), ), @@ -280,7 +283,8 @@ class _MessageHistoryPageWidgetState extends State wit ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, @@ -288,7 +292,6 @@ class _MessageHistoryPageWidgetState extends State wit ); } - Widget _item(BuildContext context, dynamic jsonBody) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -314,8 +317,8 @@ class _MessageHistoryPageWidgetState extends State wit jsonBody['MSG_DESTINO_TP'] == 'T' ? Icons.language : jsonBody['MSG_DESTINO_TP'] == 'P' - ? Icons.person - : Icons.home, + ? Icons.person + : Icons.home, color: FlutterFlowTheme.of(context).primary, size: 25, ), @@ -340,7 +343,8 @@ class _MessageHistoryPageWidgetState extends State wit padding: const EdgeInsets.only(left: 5), child: Icon( Icons.history, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, size: 15, ), ), @@ -351,7 +355,7 @@ class _MessageHistoryPageWidgetState extends State wit fontWeight: FontWeight.bold, fontSize: 10, color: - FlutterFlowTheme.of(context).customColor6, + FlutterFlowTheme.of(context).customColor6, ), overflow: TextOverflow.ellipsis, ), @@ -366,7 +370,8 @@ class _MessageHistoryPageWidgetState extends State wit padding: const EdgeInsets.only(left: 5), child: Icon( Icons.message, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, size: 15, ), ), @@ -388,7 +393,4 @@ class _MessageHistoryPageWidgetState extends State wit ), )); } - } - - From 5527f35e25045e2c3e8138e46f9b189693b03900 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 13 Aug 2024 09:21:14 -0300 Subject: [PATCH 69/72] WIP --- .../details_component_action.dart | 2 + ...iter_vistor_template_component_widget.dart | 2 - ...earch_modal_template_component_widget.dart | 2 - .../schedule_complete_visit_page_widget.dart | 45 ++++++++----------- .../visit_history_page_widget.dart | 8 +--- 5 files changed, 22 insertions(+), 37 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index 21e7808a..dd023556 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -18,7 +18,9 @@ Widget buildDetails( BuildContext context, Future Function(BuildContext, int, int, String, String)? changeStatusAction) { + log('test'); log('visitaWrapItem: ${visitaWrapItem.toString()}'); + log('test'); return VisitRequestTemplateComponentWidget( buttons: [ if (getStatus(visitaWrapItem['VAW_STATUS']) == diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 4172d6bf..7207e724 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -237,10 +237,8 @@ class _RegisiterVistorTemplateComponentWidgetState ), onChanged: (value) { _model.debounce(() async { - log('data'); var data = await _model.getVisitanteByDocument( value, context); - log('data: $data'); setState(() { _isVisitorRegistered = data; }); diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index b545ed9f..dcec2626 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -479,7 +479,6 @@ class _VisitorSearchModalTemplateComponentWidgetState PhpGroup.getVisitorByDocCall .vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != null) { - log('visitor found: ${PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? ''))}'); _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( (_model.getVisitorByDoc?.jsonBody ?? ''), )); @@ -498,7 +497,6 @@ class _VisitorSearchModalTemplateComponentWidgetState ); }, ).then((value) => safeSetState(() { - log('value: $value'); if (value != null) { addVisitor(context); } diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index f640d116..2b8c7afb 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -75,7 +75,7 @@ class _ScheduleCompleteVisitPageWidgetState .toList() .cast(); _model.visitorStrList = widget.visitorStrList!; - setState(() {}); + safeSetState(() {}); } else { return; } @@ -85,7 +85,7 @@ class _ScheduleCompleteVisitPageWidgetState vsync: this, length: 2, initialIndex: 0, - )..addListener(() => setState(() {})); + )..addListener(() => safeSetState(() {})); _model.textController1 ??= TextEditingController(); _model.textFieldFocusNode1 ??= FocusNode(); @@ -116,7 +116,7 @@ class _ScheduleCompleteVisitPageWidgetState if (newItems.isNotEmpty) { _visitHistoryList.addAll(newItems); _visitHistoryLoadingIdx++; - setState(() {}); + safeSetState(() {}); } } @@ -146,8 +146,7 @@ class _ScheduleCompleteVisitPageWidgetState key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, appBar: appBarScheduleCompleteVisit(context), - body: - bodyScheduleCompleteVisit(context, _model, setState, safeSetState), + body: bodyScheduleCompleteVisit(context, _model, safeSetState), ), ); } @@ -191,11 +190,8 @@ PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { ); } -Widget bodyScheduleCompleteVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { +Widget bodyScheduleCompleteVisit(BuildContext context, + ScheduleCompleteVisitPageModel _model, Function safeSetState) { return SafeArea( top: true, child: Column( @@ -237,12 +233,12 @@ Widget bodyScheduleCompleteVisit( child: TabBarView( controller: _model.tabBarController, children: [ - scheduleVisit(context, _model, setState, safeSetState), + scheduleVisit(context, _model, safeSetState), wrapWithModel( model: _model, child: VisitHistoryWidget(), updateCallback: () { - setState(() {}); + safeSetState(() {}); }, updateOnChange: true), ], @@ -253,11 +249,8 @@ Widget bodyScheduleCompleteVisit( ); } -Widget scheduleVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { +Widget scheduleVisit(BuildContext context, + ScheduleCompleteVisitPageModel _model, Function safeSetState) { return SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, @@ -512,7 +505,7 @@ Widget scheduleVisit( ); }); } - setState(() { + safeSetState(() { _model.textController1?.text = dateTimeFormat( 'd/M/y H:mm:ss', _model.datePicked1, @@ -760,7 +753,7 @@ Widget scheduleVisit( ); }); } - setState(() { + safeSetState(() { _model.textController2?.text = dateTimeFormat( 'd/M/y H:mm:ss', _model.datePicked2, @@ -896,7 +889,7 @@ Widget scheduleVisit( onPressed: () async { _model.removeFromVisitorJsonList( visitorListViewItem); - setState(() {}); + safeSetState(() {}); }, icon: const Icon(Icons.close), ), @@ -946,13 +939,13 @@ Widget scheduleVisit( visitorsParam! .toList() .cast(); - setState(() {}); + safeSetState(() {}); }, getDocs: (docsParam) async { _model.visitorStrList = strListToStr( docsParam!.toList()); - setState(() {}); + safeSetState(() {}); }, ), ), @@ -1125,7 +1118,7 @@ Widget scheduleVisit( .reasonsMotDescStrList( dropDownGetDadosResponse.jsonBody, ), - onChanged: (val) => setState( + onChanged: (val) => safeSetState( () => _model.dropDownValue1 = val), width: double.infinity, height: double.infinity, @@ -1250,7 +1243,7 @@ Widget scheduleVisit( .levelNACDescricaoStrList( dropDownGetDadosResponse.jsonBody, ), - onChanged: (val) => setState( + onChanged: (val) => safeSetState( () => _model.dropDownValue2 = val), width: double.infinity, height: double.infinity, @@ -1381,7 +1374,7 @@ Widget scheduleVisit( Switch.adaptive( value: _model.switchValue!, onChanged: (newValue) async { - setState(() => _model.switchValue = newValue); + safeSetState(() => _model.switchValue = newValue); }, applyCupertinoTheme: false, focusColor: FlutterFlowTheme.of(context).primary, @@ -1657,7 +1650,7 @@ Widget scheduleVisit( } }); - setState(() {}); + safeSetState(() {}); }); }, ), diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index fc5a818e..c502759a 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -45,12 +45,10 @@ class _VisitHistoryWidgetState extends State { ), ); - log('API response: ${response.jsonBody}'); - var newVisits = response.jsonBody['visitas'] as List?; // Ajuste conforme a estrutura da resposta if (newVisits != null && newVisits.isNotEmpty) { - setState(() { + safeSetState(() { visitaWrap.addAll(newVisits); }); return response; @@ -95,8 +93,6 @@ class _VisitHistoryWidgetState extends State { ); } - log('[A] - ${visitaWrap.length.toString()}'); - return ListView.builder( itemCount: visitaWrap.length + 1, shrinkWrap: true, @@ -114,7 +110,6 @@ class _VisitHistoryWidgetState extends State { } final visitaWrapItem = visitaWrap[index]; - log('[B] - ${visitaWrap.length.toString()}'); return CardItemTemplateComponentWidget( imagePath: @@ -183,7 +178,6 @@ class _VisitHistoryWidgetState extends State { ); }, ).whenComplete(() { - log('Dialog closed'); // updateVisitFuture(); _fetchVisits().then((response) { safeSetState(() { From 60647a708dc158e023c7e29aa50fa08746f0d57a Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 13 Aug 2024 11:01:24 -0300 Subject: [PATCH 70/72] WIP --- .../pushNotificationService.dart | 4 +- .../details_component_action.dart | 28 +++++-------- .../schedule_complete_visit_page_widget.dart | 40 +++++++++++++++++-- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 537e780a..c4a068b7 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -288,7 +288,9 @@ class PushNotificationService { } static Future _firebaseMessagingBackgroundHandler( - RemoteMessage message) async {} + RemoteMessage message) async { + log('Handling a background message: ${message.messageId}'); + } } class NotificationHandler { diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index dd023556..d3805086 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -10,6 +10,7 @@ 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/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; @@ -111,24 +112,15 @@ Widget buildDetails( Navigator.pop(context); Navigator.pop(context); - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'dropdownValue1': visitaWrapItem['MOT_DESCRICAO'], - 'dropdownValue2': serializeParam( - visitaWrapItem['NAC_DESCRICAO'], - ParamType.String, - ), - 'visitorStrList': serializeParam( - visitaWrapItem['VTE_DOCUMENTO'], - ParamType.String, - ), - 'visitorJsonList': serializeParam( - [visitaWrapItem], - ParamType.JSON, - isList: true, - ), - }.withoutNulls, + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ScheduleCompleteVisitPageWidget( + dropdownValue1: visitaWrapItem['MOT_DESCRICAO'], + dropdownValue2: visitaWrapItem['NAC_DESCRICAO'], + visitorJsonList: [visitaWrapItem], + visitorStrList: visitaWrapItem['VTE_DOCUMENTO'], + )), ); }, options: FFButtonOptions( diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 2b8c7afb..16f06d15 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -30,10 +30,14 @@ import 'package:provider/provider.dart'; class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ super.key, + this.dropdownValue1, + this.dropdownValue2, this.visitorStrList, this.visitorJsonList, }); + final String? dropdownValue1; + final String? dropdownValue2; final String? visitorStrList; final List? visitorJsonList; @@ -75,12 +79,23 @@ class _ScheduleCompleteVisitPageWidgetState .toList() .cast(); _model.visitorStrList = widget.visitorStrList!; + + safeSetState(() {}); + } else { + return; + } + + if ((widget.dropdownValue1 != null && widget.dropdownValue1 != '') && + (widget.dropdownValue2 != null && widget.dropdownValue2 != '')) { + _model.dropDownValue1 = widget.dropdownValue1!; + log('_model.dropdownValue1: ${_model.dropDownValue1 ?? ''}'); + _model.dropDownValue2 = widget.dropdownValue2!; + log('_model.dropdownValue2: ${_model.dropDownValue2 ?? ''}'); safeSetState(() {}); } else { return; } }); - _model.tabBarController = TabController( vsync: this, length: 2, @@ -1075,7 +1090,6 @@ Widget scheduleVisit(BuildContext context, atividade: 'getDados', ), builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. if (!snapshot.hasData) { return Center( child: SizedBox( @@ -1095,14 +1109,32 @@ Widget scheduleVisit(BuildContext context, PhpGroup.getDadosCall.reasonsJsonList( dropDownGetDadosResponse.jsonBody, ); + // Algoritmo de match + if (_model.dropDownValue1 != null && + _model.dropDownValue1!.isNotEmpty) { + final matchedValue = + reasonsJsonList?.firstWhere( + (element) => + element.toString() == + _model.dropDownValue1, + orElse: () => null, + ); + if (matchedValue != null) { + WidgetsBinding.instance + .addPostFrameCallback((_) { + _model.dropDownValueController1 + ?.value = matchedValue.toString(); + }); + } + } + return FlutterFlowDropDown( fillColor: FlutterFlowTheme.of(context) .primaryBackground, controller: _model.dropDownValueController1 ??= FormFieldController( - _model.dropDownValue1 ??= '', - ), + _model.dropDownValue1 ?? ''), options: reasonsJsonList != null && reasonsJsonList != [] ? List.from( From 5a67d5d3f9336df6121deb06830df20ff692750e Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 13 Aug 2024 11:19:27 -0300 Subject: [PATCH 71/72] WIP --- .../schedule_complete_visit_page_widget.dart | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 16f06d15..05d0a656 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1109,7 +1109,7 @@ Widget scheduleVisit(BuildContext context, PhpGroup.getDadosCall.reasonsJsonList( dropDownGetDadosResponse.jsonBody, ); - // Algoritmo de match + // Algoritmo de match // PODE MANDAR DE VASCO if (_model.dropDownValue1 != null && _model.dropDownValue1!.isNotEmpty) { final matchedValue = @@ -1597,24 +1597,14 @@ Widget scheduleVisit(BuildContext context, child: Dialog( alignment: Alignment.topCenter, child: SizedBox( - // width: MediaQuery.of(context).size.width, - // height: MediaQuery.of(context).size.height * 0.7, - // child: VisitDetailsModalTemplateComponentWidget( - // visitStartDateStr: _model.textController1.text, - // visitEndDateStr: _model.textController2.text, - // visitReasonStr: _model.dropDownValue1, - // visitLevelStr: _model.dropDownValue2, - // visitTempStr: - // _model.switchValue == true ? 'Sim' : 'Não', - // visitObsStr: _model.textController3.text, - // visitorStrList: _model.visitorStrList, - // visitorJsonList: _model.visitorJsonList, - // updateToggleIdx: () async {}, - // repeatVisitSchedule: () async {}, - // ), child: VisitRequestTemplateComponentWidget( buttons: [ - FlutterFlowIconButton( + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Done', + ptText: 'Confirmar', + ), icon: const Icon(Icons.done), onPressed: () async { log('visitorStrList ${_model.visitorStrList}'); @@ -1685,6 +1675,23 @@ Widget scheduleVisit(BuildContext context, safeSetState(() {}); }); }, + options: FFButtonOptions( + width: 130, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), ), ], imagePath: From 91d219e157da9d05006663eb0ec3ebe9169c9c06 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Tue, 13 Aug 2024 16:57:02 -0300 Subject: [PATCH 72/72] fix: Selector de dados (Motivo e Nivel) --- .../details_component_action.dart | 13 +- .../schedule_complete_visit_page_widget.dart | 126 +++++++----------- 2 files changed, 52 insertions(+), 87 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index d3805086..fda1e116 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -19,9 +19,7 @@ Widget buildDetails( BuildContext context, Future Function(BuildContext, int, int, String, String)? changeStatusAction) { - log('test'); - log('visitaWrapItem: ${visitaWrapItem.toString()}'); - log('test'); + return VisitRequestTemplateComponentWidget( buttons: [ if (getStatus(visitaWrapItem['VAW_STATUS']) == @@ -116,11 +114,12 @@ Widget buildDetails( context, MaterialPageRoute( builder: (context) => ScheduleCompleteVisitPageWidget( - dropdownValue1: visitaWrapItem['MOT_DESCRICAO'], + dropdownValue1: visitaWrapItem['MOT_DESCRICAO'], dropdownValue2: visitaWrapItem['NAC_DESCRICAO'], visitorJsonList: [visitaWrapItem], visitorStrList: visitaWrapItem['VTE_DOCUMENTO'], - )), + ) + ), ); }, options: FFButtonOptions( @@ -142,8 +141,8 @@ Widget buildDetails( status.active) // SHARE ACTION FFButtonWidget( text: FFLocalizations.of(context).getVariableText( - ptText: 'Reagendar', - enText: 'Reschedule', + ptText: 'Compartilhar', + enText: 'Share', ), icon: const Icon(Icons.share), onPressed: () async { diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 05d0a656..807a21f1 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -64,10 +64,7 @@ class _ScheduleCompleteVisitPageWidgetState // On page load action. SchedulerBinding.instance.addPostFrameCallback((_) async { - if ((widget.visitorStrList != null && widget.visitorStrList != '') && - ((widget.visitorJsonList != null && - (widget.visitorJsonList)!.isNotEmpty) != - null)) { + if ((widget.visitorStrList != null && widget.visitorStrList != '') && ((widget.visitorJsonList != null && (widget.visitorJsonList)!.isNotEmpty) != null)) { _model.visitorJsonList = widget.visitorJsonList! .where((e) => widget.visitorStrList == @@ -85,12 +82,9 @@ class _ScheduleCompleteVisitPageWidgetState return; } - if ((widget.dropdownValue1 != null && widget.dropdownValue1 != '') && - (widget.dropdownValue2 != null && widget.dropdownValue2 != '')) { + if ((widget.dropdownValue1 != null && widget.dropdownValue1 != '') && (widget.dropdownValue2 != null && widget.dropdownValue2 != '')) { _model.dropDownValue1 = widget.dropdownValue1!; - log('_model.dropdownValue1: ${_model.dropDownValue1 ?? ''}'); _model.dropDownValue2 = widget.dropdownValue2!; - log('_model.dropdownValue2: ${_model.dropDownValue2 ?? ''}'); safeSetState(() {}); } else { return; @@ -135,7 +129,7 @@ class _ScheduleCompleteVisitPageWidgetState } } - void_scrollListener() { + void _scrollListener() { if (_visitHistoryController.position.pixels == _visitHistoryController.position.maxScrollExtent) { _loadMoreVisitHistory(); @@ -1103,55 +1097,30 @@ Widget scheduleVisit(BuildContext context, ), ); } - final dropDownGetDadosResponse = - snapshot.data!; - final reasonsJsonList = - PhpGroup.getDadosCall.reasonsJsonList( - dropDownGetDadosResponse.jsonBody, - ); - // Algoritmo de match // PODE MANDAR DE VASCO - if (_model.dropDownValue1 != null && - _model.dropDownValue1!.isNotEmpty) { - final matchedValue = - reasonsJsonList?.firstWhere( - (element) => - element.toString() == - _model.dropDownValue1, - orElse: () => null, - ); - if (matchedValue != null) { - WidgetsBinding.instance - .addPostFrameCallback((_) { - _model.dropDownValueController1 - ?.value = matchedValue.toString(); - }); + + final dropDownGetDadosResponse = snapshot.data!; + final reasonsJsonList = PhpGroup.getDadosCall.reasonsJsonList(dropDownGetDadosResponse.jsonBody); + + if (_model.dropDownValue1 != '' && _model.dropDownValue1 != null) { + String value = _model.dropDownValue1.toString() ?? ''; + + if (value.contains('{') && value.contains('}') && value.contains(':')) { + // log("Valor e um Objeto | Usuário Escolheu o Motivo ${_model.dropDownValue1}"); + } else { + // log("Valor e uma String | Usuário Escolheu o Motivo ${_model.dropDownValue1}"); + if (reasonsJsonList != null && reasonsJsonList.isNotEmpty) { + var item = reasonsJsonList.where((reason) => reason['MOT_DESCRICAO'].toString().contains(_model.dropDownValue1 ?? '')); + _model.dropDownValue1 = item.firstOrNull.toString() ?? ''; + } } } return FlutterFlowDropDown( - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, - controller: - _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ?? ''), - options: reasonsJsonList != null && - reasonsJsonList != [] - ? List.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()) - : [], - optionLabels: PhpGroup.getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse.jsonBody, - ), - onChanged: (val) => safeSetState( - () => _model.dropDownValue1 = val), + fillColor: FlutterFlowTheme.of(context).primaryBackground, + controller: _model.dropDownValueController1 ??= FormFieldController(_model.dropDownValue1 ??= ''), + options: reasonsJsonList != null && reasonsJsonList != [] ? reasonsJsonList.map((e) => e.toString()).toList() : [], + optionLabels: PhpGroup.getDadosCall.reasonsMotDescStrList(dropDownGetDadosResponse.jsonBody), + onChanged: (val) => safeSetState(() => _model.dropDownValue1 = val), width: double.infinity, height: double.infinity, textStyle: FlutterFlowTheme.of(context) @@ -1253,30 +1222,29 @@ Widget scheduleVisit(BuildContext context, ), ); } - final dropDownGetDadosResponse = - snapshot.data!; - final lavelList = - PhpGroup.getDadosCall.levelJsonList( - dropDownGetDadosResponse.jsonBody, - ); + + final dropDownGetDadosResponse = snapshot.data!; + final lavelList = PhpGroup.getDadosCall.levelJsonList(dropDownGetDadosResponse.jsonBody); + + if (_model.dropDownValue2 != '' && _model.dropDownValue2 != null) { + String value = _model.dropDownValue2.toString() ?? ''; + + if (value.contains('{') && value.contains('}') && value.contains(':')) { + // log("Valor e um Objeto | Usuário Escolheu o Nivel ${_model.dropDownValue2}"); + } else { + // log("Valor e uma String | Usuário Escolheu o Nivel ${_model.dropDownValue2}"); + if (lavelList != null && lavelList.isNotEmpty) { + var item = lavelList.where((level) => level['NAC_DESCRICAO'].toString().contains(_model.dropDownValue2 ?? '')); + _model.dropDownValue2 = item.firstOrNull.toString() ?? ''; + } + } + } + return FlutterFlowDropDown( - controller: - _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= '', - ), - options: - lavelList != null && lavelList != [] - ? List.from(lavelList! - .map((e) => e.toString()) - .toList()) - : [], - optionLabels: PhpGroup.getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse.jsonBody, - ), - onChanged: (val) => safeSetState( - () => _model.dropDownValue2 = val), + controller: _model.dropDownValueController2 ??= FormFieldController(_model.dropDownValue2 ??= ''), + options: lavelList != null && lavelList != [] ? lavelList.map((e) => e.toString()).toList() : [], + optionLabels: PhpGroup.getDadosCall.levelNACDescricaoStrList(dropDownGetDadosResponse.jsonBody), + onChanged: (val) => safeSetState(() => _model.dropDownValue2 = val), width: double.infinity, height: double.infinity, textStyle: FlutterFlowTheme.of(context) @@ -1323,7 +1291,7 @@ Widget scheduleVisit(BuildContext context, ), ], ), - if (_model.dropDownValue1 == '') + if (_model.dropDownValue2 == '') Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -1584,7 +1552,6 @@ Widget scheduleVisit(BuildContext context, ), onPressed: _model.isValid() ? () async { - log(_model.dropDownValue1.toString()); await showDialog( context: context, @@ -1607,7 +1574,6 @@ Widget scheduleVisit(BuildContext context, ), icon: const Icon(Icons.done), onPressed: () async { - log('visitorStrList ${_model.visitorStrList}'); showAlertDialog( context, FFLocalizations.of(context)