From b6e83dbaa83458117b2dc7ab62a3d6a05ac2923e Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Thu, 14 Nov 2024 11:10:08 -0300 Subject: [PATCH] WIP --- .../menu_component/menu_component_model.dart | 80 +++++++++---------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart index 299e47d4..a25aae36 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -72,12 +72,6 @@ class MenuComponentModel extends FlutterFlowModel { return null; } - /// ABOUT THE VISITORS - if (options.contains(MenuOption.VisitorsRegister)) - addMenuEntry(Icons.person_add_alt_1_outlined, 'Register Visitor', 'Cadastrar Visitante', () async { - await open(context, '/registerVisitorPage'); - safeSetState; - }); if (options.contains(MenuOption.WorkersOnTheProperty)) addMenuEntry(Icons.engineering_outlined, 'Schedule Providers', 'Agendar Prestadores', () async { if (await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true') @@ -107,31 +101,6 @@ class MenuComponentModel extends FlutterFlowModel { await open(context, '/scheduleCompleteVisitPage'); safeSetState; }); - - /// ABOUT THE PROPERTY - if (options.contains(MenuOption.PetsOnTheProperty)) - addMenuEntry(Icons.pets, 'Pets', 'Pets', () async { - if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') - await open(context, '/petsOnThePropertyPage'); - else - DialogUnavailable.unavailableFeature(context); - safeSetState; - }); - if (options.contains(MenuOption.ResidentsOnTheProperty)) - addMenuEntry(Icons.groups, 'Residents', 'Moradores', () async { - await open(context, '/peopleOnThePropertyPage'); - safeSetState; - }); - if (options.contains(MenuOption.VehiclesOnTheProperty)) - addMenuEntry(Symbols.directions_car, 'Vehicles', 'Veículos', () async { - await open(context, '/vehiclesOnThePropertyPage'); - safeSetState; - }); - if (options.contains(MenuOption.VisitsOnTheProperty)) - addMenuEntry(Symbols.perm_contact_calendar, 'Opened Visits', 'Visitas em Aberto', () async { - await open(context, '/visitsOnThePropertyPage'); - safeSetState; - }); if (options.contains(MenuOption.PackagesOnTheProperty)) addMenuEntry(Icons.inventory_2_outlined, 'Orders', 'Encomendas', () async { if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') @@ -140,23 +109,17 @@ class MenuComponentModel extends FlutterFlowModel { DialogUnavailable.unavailableFeature(context); safeSetState; }); - - /// ABOUT THE RESIDENTS - if (options.contains(MenuOption.PetsRegister)) - addMenuEntry(Icons.pets, 'Pets Register', 'Cadastrar Pet', () async { - if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') - await open(context, '/petsPage'); - else - DialogUnavailable.unavailableFeature(context); - safeSetState; - }); if (options.contains(MenuOption.ReservationsOnTheLocal)) addMenuEntry(Icons.event_available, 'Reservations', 'Reservas', () async { if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') await open(context, '/reservation'); else DialogUnavailable.unavailableFeature(context); - + safeSetState; + }); + if (options.contains(MenuOption.VisitorsRegister)) + addMenuEntry(Icons.person_add_alt_1_outlined, 'Register Visitor', 'Cadastrar Visitante', () async { + await open(context, '/registerVisitorPage'); safeSetState; }); if (options.contains(MenuOption.QRCodeAccessInProperty)) @@ -164,11 +127,24 @@ class MenuComponentModel extends FlutterFlowModel { await open(context, '/qrCodePage'); safeSetState; }); + if (options.contains(MenuOption.PetsOnTheProperty)) + addMenuEntry(Icons.pets, 'Pets', 'Pets', () async { + if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') + await open(context, '/petsOnThePropertyPage'); + else + DialogUnavailable.unavailableFeature(context); + safeSetState; + }); if (options.contains(MenuOption.AccessOnTheProperty)) addMenuEntry(Icons.transfer_within_a_station_outlined, 'Access History', 'Consultar Acessos', () async { await open(context, '/acessHistoryPage'); safeSetState; }); + if (options.contains(MenuOption.ResidentsOnTheProperty)) + addMenuEntry(Icons.groups, 'Residents', 'Moradores', () async { + await open(context, '/peopleOnThePropertyPage'); + safeSetState; + }); if (options.contains(MenuOption.LiberationsOnTheProperty)) addMenuEntry(Icons.how_to_reg_outlined, 'Liberations History', 'Consultar Liberações', () async { await open(context, '/liberationHistory'); @@ -179,8 +155,24 @@ class MenuComponentModel extends FlutterFlowModel { await open(context, '/messageHistoryPage'); safeSetState; }); - - /// ABOUT THE SYSTEM + if (options.contains(MenuOption.VehiclesOnTheProperty)) + addMenuEntry(Symbols.directions_car, 'Vehicles', 'Veículos', () async { + await open(context, '/vehiclesOnThePropertyPage'); + safeSetState; + }); + if (options.contains(MenuOption.VisitsOnTheProperty)) + addMenuEntry(Symbols.perm_contact_calendar, 'Opened Visits', 'Visitas em Aberto', () async { + await open(context, '/visitsOnThePropertyPage'); + safeSetState; + }); + if (options.contains(MenuOption.PetsRegister)) + addMenuEntry(Icons.pets, 'Pets Register', 'Cadastrar Pet', () async { + if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') + await open(context, '/petsPage'); + else + DialogUnavailable.unavailableFeature(context); + safeSetState; + }); if (options.contains(MenuOption.AboutProperty)) addMenuEntry(Icons.home, 'About Property', 'Sobre a Propriedade', () async { if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')