diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index d7303aa6..fcef9a98 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -58,14 +58,16 @@ class PhpGroup { static GetVehiclesByProperty getVehiclesByProperty = GetVehiclesByProperty(); static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty(); static GetOpenedVisits getOpenedVisits = GetOpenedVisits(); + static TestCall testCall = TestCall(); + static GetLicense getLicense = GetLicense(); } class GetOpenedVisits { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? ''; + final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? ''; + final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? ''; const String atividade = 'getOpenedVisits'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( @@ -95,9 +97,9 @@ class GetOpenedVisits { class GetResidentsByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? ''; + final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? ''; + final String cliID = await StorageHelper().g(KeychainStorageKey.clientUUID.value) ?? ''; const String atividade = 'getResidentsByProperty'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( @@ -126,9 +128,9 @@ class GetResidentsByProperty { class GetVehiclesByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? ''; + final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? ''; + final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? ''; const String atividade = 'getVehiclesByProperty'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( @@ -152,6 +154,7 @@ class GetVehiclesByProperty { alwaysAllowBody: false, ); } + static GetLicense getLicense = GetLicense(); static TestCall testCall = TestCall(); } 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 d0854a97..4364203d 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -74,7 +74,7 @@ class MenuComponentModel extends FlutterFlowModel { if (options.contains(MenuOption.WorkersOnTheProperty)) addMenuEntry(Icons.engineering_outlined, 'Schedule Providers', 'Agendar Prestadores', () async { - if (await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.provisional.value) == 'true') await open(context, '/provisionalSchedule'); else DialogUnavailable.unavailableFeature(context); @@ -82,7 +82,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.DeliverySchedule)) addMenuEntry(Icons.sports_motorsports_outlined, 'Schedule Deliveries', 'Agendar Entregas', () async { - if (await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.provisional.value) == 'true') await open(context, '/deliverySchedule'); else DialogUnavailable.unavailableFeature(context); @@ -90,7 +90,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.FastPassSchedule)) addMenuEntry(Icons.attach_email_outlined, 'Invite Visitor', 'Convidar Visitante', () async { - if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true') await open(context, '/fastPassPage'); else DialogUnavailable.unavailableFeature(context); @@ -103,7 +103,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.PackagesOnTheProperty)) addMenuEntry(Icons.inventory_2_outlined, 'Orders', 'Encomendas', () async { - if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true') await open(context, '/packageOrder'); else DialogUnavailable.unavailableFeature(context); @@ -111,7 +111,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.ReservationsOnTheLocal)) addMenuEntry(Icons.event_available, 'Reservations', 'Reservas', () async { - if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true') await open(context, '/reservation'); else DialogUnavailable.unavailableFeature(context); @@ -129,7 +129,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.PetsOnTheProperty)) addMenuEntry(Icons.pets, 'Pets', 'Pets', () async { - if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.pets.value) == 'true') await open(context, '/petsOnThePropertyPage'); else DialogUnavailable.unavailableFeature(context); @@ -137,7 +137,7 @@ class MenuComponentModel extends FlutterFlowModel { }); if (options.contains(MenuOption.PetsRegister)) addMenuEntry(Icons.pets, 'Pets Register', 'Cadastrar Pet', () async { - if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.pets.value) == 'true') await open(context, '/petsPage'); else DialogUnavailable.unavailableFeature(context); @@ -176,7 +176,7 @@ class MenuComponentModel extends FlutterFlowModel { if (options.contains(MenuOption.AboutProperty)) addMenuEntry(Icons.home, 'About Property', 'Sobre a Propriedade', () async { - if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') + if (await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true') await open(context, '/aboutProperty'); else DialogUnavailable.unavailableFeature(context); diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 6e7114f8..d99be82b 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -18,8 +18,8 @@ class PeopleOnThePropertyPageModel extends FlutterFlowModel { void dispose() {} Future initAsync() async { - devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? ''; + cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? ''; onRefresh?.call(); }