This commit is contained in:
J. A. Messias 2024-11-18 10:58:12 -03:00
parent aed746fd58
commit 0a22f736da
4 changed files with 24 additions and 21 deletions

View File

@ -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<ApiCallResponse> 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<ApiCallResponse> 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<ApiCallResponse> 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();
}

View File

@ -74,7 +74,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
});
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<MenuComponentWidget> {
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);

View File

@ -18,8 +18,8 @@ class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyP
}
void initVariables() 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();
}

View File

@ -30,8 +30,8 @@ class VisitsModel extends FlutterFlowModel<VehicleOnTheProperty> {
void dispose() {}
Future<void> 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();
}