From 0f41eba57f59b18b2e8c219e02436adc990b6680 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 08:44:29 -0300 Subject: [PATCH] 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 {