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 GetVehiclesByProperty getVehiclesByProperty = GetVehiclesByProperty();
static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty(); static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty();
static GetOpenedVisits getOpenedVisits = GetOpenedVisits(); static GetOpenedVisits getOpenedVisits = GetOpenedVisits();
static TestCall testCall = TestCall();
static GetLicense getLicense = GetLicense();
} }
class GetOpenedVisits { class GetOpenedVisits {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
const String atividade = 'getOpenedVisits'; const String atividade = 'getOpenedVisits';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
@ -95,9 +97,9 @@ class GetOpenedVisits {
class GetResidentsByProperty { class GetResidentsByProperty {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; final String cliID = await StorageHelper().g(KeychainStorageKey.clientUUID.value) ?? '';
const String atividade = 'getResidentsByProperty'; const String atividade = 'getResidentsByProperty';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
@ -126,9 +128,9 @@ class GetResidentsByProperty {
class GetVehiclesByProperty { class GetVehiclesByProperty {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
const String atividade = 'getVehiclesByProperty'; const String atividade = 'getVehiclesByProperty';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
@ -152,6 +154,7 @@ class GetVehiclesByProperty {
alwaysAllowBody: false, alwaysAllowBody: false,
); );
} }
static GetLicense getLicense = GetLicense(); static GetLicense getLicense = GetLicense();
static TestCall testCall = TestCall(); static TestCall testCall = TestCall();
} }

View File

@ -74,7 +74,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
if (options.contains(MenuOption.WorkersOnTheProperty)) if (options.contains(MenuOption.WorkersOnTheProperty))
addMenuEntry(Icons.engineering_outlined, 'Schedule Providers', 'Agendar Prestadores', () async { 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'); await open(context, '/provisionalSchedule');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -82,7 +82,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.DeliverySchedule)) if (options.contains(MenuOption.DeliverySchedule))
addMenuEntry(Icons.sports_motorsports_outlined, 'Schedule Deliveries', 'Agendar Entregas', () async { 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'); await open(context, '/deliverySchedule');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -90,7 +90,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.FastPassSchedule)) if (options.contains(MenuOption.FastPassSchedule))
addMenuEntry(Icons.attach_email_outlined, 'Invite Visitor', 'Convidar Visitante', () async { 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'); await open(context, '/fastPassPage');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -103,7 +103,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.PackagesOnTheProperty)) if (options.contains(MenuOption.PackagesOnTheProperty))
addMenuEntry(Icons.inventory_2_outlined, 'Orders', 'Encomendas', () async { 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'); await open(context, '/packageOrder');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -111,7 +111,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.ReservationsOnTheLocal)) if (options.contains(MenuOption.ReservationsOnTheLocal))
addMenuEntry(Icons.event_available, 'Reservations', 'Reservas', () async { 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'); await open(context, '/reservation');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -129,7 +129,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.PetsOnTheProperty)) if (options.contains(MenuOption.PetsOnTheProperty))
addMenuEntry(Icons.pets, 'Pets', 'Pets', () async { 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'); await open(context, '/petsOnThePropertyPage');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -137,7 +137,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
}); });
if (options.contains(MenuOption.PetsRegister)) if (options.contains(MenuOption.PetsRegister))
addMenuEntry(Icons.pets, 'Pets Register', 'Cadastrar Pet', () async { 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'); await open(context, '/petsPage');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);
@ -176,7 +176,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
if (options.contains(MenuOption.AboutProperty)) if (options.contains(MenuOption.AboutProperty))
addMenuEntry(Icons.home, 'About Property', 'Sobre a Propriedade', () async { 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'); await open(context, '/aboutProperty');
else else
DialogUnavailable.unavailableFeature(context); DialogUnavailable.unavailableFeature(context);

View File

@ -18,8 +18,8 @@ class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyP
} }
void initVariables() async { void initVariables() async {
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
onRefresh?.call(); onRefresh?.call();
} }

View File

@ -30,8 +30,8 @@ class VisitsModel extends FlutterFlowModel<VehicleOnTheProperty> {
void dispose() {} void dispose() {}
Future<void> initAsync() async { Future<void> initAsync() async {
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
onRefresh?.call(); onRefresh?.call();
} }