dart format
This commit is contained in:
parent
69b5574064
commit
72967aabd1
|
@ -14,9 +14,8 @@ void main() {
|
|||
|
||||
group('Initialization', () {
|
||||
group('Navigation', () {
|
||||
setUpAll(() async => await initializeApp().then((_) async =>
|
||||
StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))
|
||||
);
|
||||
setUpAll(() async => await initializeApp().then(
|
||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||
testWidgets('Test Welcome', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testWelcome();
|
||||
|
@ -27,18 +26,16 @@ void main() {
|
|||
});
|
||||
group('Authentication', () {
|
||||
group('Sign in', () {
|
||||
setUpAll(() async => await initializeApp().then((_) async =>
|
||||
StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))
|
||||
);
|
||||
setUpAll(() async => await initializeApp().then(
|
||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||
testWidgets('Test Sign In', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testSignIn();
|
||||
});
|
||||
});
|
||||
group('Sign up', () {
|
||||
setUpAll(() async => await initializeApp().then((_) async =>
|
||||
StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))
|
||||
);
|
||||
setUpAll(() async => await initializeApp().then(
|
||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testSignUp();
|
||||
|
|
|
@ -57,8 +57,10 @@ class PhpGroup {
|
|||
class UnregisterDevice {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
callName: 'unregisterDevice',
|
||||
|
@ -85,9 +87,12 @@ class UnregisterDevice {
|
|||
class DeletePet {
|
||||
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'excluirPet';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -130,9 +135,12 @@ class UpdatePet {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'atualizarPet';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -176,9 +184,12 @@ class GetPets {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'consultaPets';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -210,9 +221,12 @@ class GetPetPhoto {
|
|||
Future<ApiCallResponse> call({final int? petId}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'consultaFotoPet';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -253,9 +267,12 @@ class RegisterPet {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'cadastrarPet';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -298,9 +315,12 @@ class BuscaEnconcomendas {
|
|||
final String? adresseeType,
|
||||
final String? status,
|
||||
}) async {
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getEncomendas';
|
||||
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
@ -342,9 +362,12 @@ class CancelaVisita {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'cancelaVisita';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -376,8 +399,10 @@ class CancelaVisita {
|
|||
|
||||
class DeleteAccount {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -408,9 +433,12 @@ class ChangePanic {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -444,9 +472,12 @@ class ChangePass {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -480,9 +511,12 @@ class RespondeVinculo {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
callName: 'respondeVinculo',
|
||||
|
@ -514,9 +548,12 @@ class ChangeNotifica {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -548,8 +585,10 @@ class UpdToken {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String token = (await StorageHelper.instance.get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -577,11 +616,15 @@ class UpdToken {
|
|||
class LoginCall {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String email = (await StorageHelper.instance.get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
||||
final String password = (await StorageHelper.instance.get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
||||
final String type = (await StorageHelper.instance.get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||
final String description = (await StorageHelper.instance.get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
||||
final String password =
|
||||
(await StorageHelper.instance.get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
||||
final String type =
|
||||
(await StorageHelper.instance.get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||
final String description =
|
||||
(await StorageHelper.instance.get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
||||
final String token = await FirebaseMessagingService.getToken();
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -656,9 +699,12 @@ class ChangePasswordCall {
|
|||
required final String psswd,
|
||||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
callName: 'changePassword',
|
||||
|
@ -717,8 +763,10 @@ class GetLocalsCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
callName: 'getLocals',
|
||||
|
@ -757,9 +805,12 @@ class PostScheduleVisitorCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'putVisitante';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -812,9 +863,12 @@ class PostScheduleVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'putVisita';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -866,9 +920,12 @@ class GetScheduleVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getVisitas';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1140,9 +1197,12 @@ class GetDadosCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getDados';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1373,9 +1433,12 @@ class GetVisitorByDocCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getVisitante';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1427,9 +1490,12 @@ class GetFotoVisitanteCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getFotoVisitante';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1466,9 +1532,12 @@ class PostProvVisitSchedulingCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'putAgendamentoProv';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1515,9 +1584,12 @@ class GetVisitsCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getVisitas';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1778,9 +1850,12 @@ class DeleteVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'cancelaVisita';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1821,10 +1896,14 @@ class GetPessoasLocalCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String ownerUUID = (await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String ownerUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
callName: 'getPessoasLocal',
|
||||
|
@ -1887,9 +1966,12 @@ class RespondeSolicitacaoCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'respondeSolicitacao';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -1937,9 +2019,12 @@ class GetAccessCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getAcessos';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
@ -2186,9 +2271,12 @@ class GetLiberationsCall {
|
|||
final StreamController<ApiCallResponse> controller = StreamController();
|
||||
|
||||
Future.microtask(() async {
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getSolicitacoes';
|
||||
|
||||
try {
|
||||
|
@ -2378,9 +2466,12 @@ class GetMessagesCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String devUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
const String atividade = 'getMensagens';
|
||||
|
||||
return ApiManager.instance.makeApiCall(
|
||||
|
|
|
@ -16,7 +16,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
|||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||
|
||||
final cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
|
||||
answersRequest(
|
||||
{required BuildContext context,
|
||||
required String? ref,
|
||||
|
@ -270,7 +270,9 @@ class NotificationService {
|
|||
debug: kDebugMode);
|
||||
|
||||
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||
final bool requestOSnotification = (await StorageHelper.instance.get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) == 'true';
|
||||
final bool requestOSnotification =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) ==
|
||||
'true';
|
||||
|
||||
if (requestOSnotification == false) {
|
||||
if (isAllowed == false) {
|
||||
|
|
|
@ -27,11 +27,13 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
late Map<String, dynamic> selected;
|
||||
final List<Map<String, String>> adresseeTypeOptions = [
|
||||
{
|
||||
'title': FFLocalizations.of(StorageHelper.instance.context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||
'title':
|
||||
FFLocalizations.of(StorageHelper.instance.context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||
'value': 'MOR'
|
||||
},
|
||||
{
|
||||
'title': FFLocalizations.of(StorageHelper.instance.context!).getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||
'title': FFLocalizations.of(StorageHelper.instance.context!)
|
||||
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||
'value': 'PRO'
|
||||
},
|
||||
];
|
||||
|
@ -42,7 +44,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
'value': 'notPickedUp'
|
||||
},
|
||||
{
|
||||
'title': FFLocalizations.of(StorageHelper.instance.context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||
'title':
|
||||
FFLocalizations.of(StorageHelper.instance.context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||
'value': 'pickedUp'
|
||||
},
|
||||
];
|
||||
|
|
|
@ -98,7 +98,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
|
||||
context.pop();
|
||||
return response;
|
||||
|
@ -189,7 +190,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
if (local['CLU_STATUS'] == 'A') {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
|
||||
context.pop();
|
||||
} else if (local['CLU_STATUS'] == 'B') {
|
||||
|
|
|
@ -19,7 +19,8 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
|
|||
|
||||
Future<void> getData() async {
|
||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
setStateCallback?.call();
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
}
|
||||
|
||||
Future openDeliverySchedule(BuildContext context) async {
|
||||
final bool isProvisional = await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||
final bool isProvisional =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||
if (isProvisional == true) {
|
||||
context.push(
|
||||
'/deliverySchedule',
|
||||
|
@ -78,7 +79,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
}
|
||||
|
||||
Future openProvisionalSchedule(BuildContext context) async {
|
||||
final isProvisional = await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||
final isProvisional =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||
if (isProvisional == true) {
|
||||
context.push(
|
||||
'/provisionalSchedule',
|
||||
|
@ -205,7 +207,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
}
|
||||
|
||||
Future openMyOrders(BuildContext context) async {
|
||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';;
|
||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||
;
|
||||
if (isWpp) {
|
||||
context.push(
|
||||
'/packageOrder',
|
||||
|
@ -223,7 +226,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
}
|
||||
|
||||
Future openReservations(BuildContext context) async {
|
||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';;
|
||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||
;
|
||||
if (isWpp) {
|
||||
context.push(
|
||||
'/reservation',
|
||||
|
@ -339,7 +343,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
}
|
||||
|
||||
Future openPetsRegister(BuildContext context) async {
|
||||
bool isPet = await StorageHelper.instance.get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true';;
|
||||
bool isPet = await StorageHelper.instance.get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true';
|
||||
;
|
||||
if (isPet) {
|
||||
context.push(
|
||||
'/petsPage',
|
||||
|
|
|
@ -19,7 +19,7 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
|||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -29,7 +29,8 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
|||
Future<void> initDatabase() async {
|
||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -134,7 +134,8 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
|||
Future<void> init() async {
|
||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
ownerUUID = (await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
setState?.call();
|
||||
|
|
|
@ -131,7 +131,8 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
|||
Future<void> initializeDatabase() async {
|
||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -39,7 +39,8 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
|||
Future<void> initializeDatabase() async {
|
||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -37,7 +37,8 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
|||
Future<void> initDatabase() async {
|
||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';;
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -78,31 +78,39 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
|||
name: '_initialize',
|
||||
path: '/',
|
||||
builder: (context, _) {
|
||||
return FutureBuilder<Widget>(
|
||||
return FutureBuilder<Widget>(
|
||||
future: () async {
|
||||
final bool isLogged = await StorageHelper.instance.get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true';
|
||||
final bool haveLocal = await StorageHelper.instance.get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true';
|
||||
final bool haveUserUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false;
|
||||
final bool haveDevUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false;
|
||||
final bool isLogged =
|
||||
await StorageHelper.instance.get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true';
|
||||
final bool haveLocal =
|
||||
await StorageHelper.instance.get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true';
|
||||
final bool haveUserUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))
|
||||
?.isNotEmpty ??
|
||||
false;
|
||||
final bool haveDevUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))
|
||||
?.isNotEmpty ??
|
||||
false;
|
||||
|
||||
if (isLogged && haveDevUUID && haveUserUUID) {
|
||||
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
||||
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
||||
} else {
|
||||
return const WelcomePageWidget();
|
||||
return const WelcomePageWidget();
|
||||
}
|
||||
}(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
DialogUtil.error(context, snapshot.error.toString());
|
||||
return const WelcomePageWidget();
|
||||
DialogUtil.error(context, snapshot.error.toString());
|
||||
return const WelcomePageWidget();
|
||||
} else {
|
||||
return snapshot.data!;
|
||||
return snapshot.data!;
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
FFRoute(
|
||||
name: 'forgotPassword',
|
||||
|
|
|
@ -24,10 +24,14 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
|
||||
Future<Map<String, String>> initVariables() async {
|
||||
final email = (await StorageHelper.instance.get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
||||
final name = (await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final devUUID = (await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID = (await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID = (await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final name =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final devUUID =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
const createdAt = '0000-00-00 00:00:00';
|
||||
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
||||
final freUserData =
|
||||
|
|
|
@ -216,7 +216,6 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
|||
}
|
||||
|
||||
PreferredSizeWidget _appBar(BuildContext context) {
|
||||
|
||||
return AppBar(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
|
|
|
@ -233,9 +233,12 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
|||
],
|
||||
onTapCardItemAction: () async {
|
||||
final devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliName =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
await showDialog(
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
|
|
|
@ -105,7 +105,8 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
petAmountRegister = (await StorageHelper.instance.get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? '';
|
||||
petAmountRegister =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
safeSetState?.call();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import '../../shared/utils/snackbar_util.dart';
|
|||
class PreferencesPageModel with ChangeNotifier {
|
||||
final unfocusNode = FocusNode();
|
||||
|
||||
|
||||
late bool isFingerprint = false;
|
||||
late bool isPerson = false;
|
||||
late bool isNotify = false;
|
||||
|
@ -24,7 +23,8 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
late bool isPanic = false;
|
||||
|
||||
Future<void> _initialize() async {
|
||||
isFingerprint = await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
isFingerprint =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
isPerson = await StorageHelper.instance.get(SQLiteStorageKey.person.value, Storage.SQLiteStorage) == 'true';
|
||||
isNotify = await StorageHelper.instance.get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true';
|
||||
isAccess = await StorageHelper.instance.get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true';
|
||||
|
@ -37,7 +37,8 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<void> enablePerson(BuildContext context) async {
|
||||
final String userDevUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userDevUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
notifyListeners();
|
||||
Share.share(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
|
@ -56,37 +57,41 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
enText: 'Are you sure you want to change your notification?',
|
||||
ptText: 'Tem certeza que deseja alterar sua notificação?',
|
||||
);
|
||||
|
||||
|
||||
onConfirm() async {
|
||||
String content;
|
||||
String value = !isNotify ? 'N' : 'S';
|
||||
await PhpGroup.changeNotifica.call(notifica: value).then((value) async {
|
||||
if (value.jsonBody['error'] == false) {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true',Storage.SQLiteStorage);
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Notification changed successfully',
|
||||
ptText: 'Notificação alterada com sucesso',
|
||||
);
|
||||
notifyListeners();
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error changing notification',
|
||||
ptText: 'Erro ao alterar notificação',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
}).catchError((e, s) {
|
||||
log('toggleNotify', error: e, stackTrace: s);
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error changing notification',
|
||||
ptText: 'Erro ao alterar notificação',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async => isNotify = await StorageHelper.instance.get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
await PhpGroup.changeNotifica
|
||||
.call(notifica: value)
|
||||
.then((value) async {
|
||||
if (value.jsonBody['error'] == false) {
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true', Storage.SQLiteStorage);
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Notification changed successfully',
|
||||
ptText: 'Notificação alterada com sucesso',
|
||||
);
|
||||
notifyListeners();
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error changing notification',
|
||||
ptText: 'Erro ao alterar notificação',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
})
|
||||
.catchError((e, s) {
|
||||
log('toggleNotify', error: e, stackTrace: s);
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error changing notification',
|
||||
ptText: 'Erro ao alterar notificação',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async => isNotify =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
context.pop();
|
||||
}
|
||||
|
||||
|
@ -96,32 +101,37 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
Future<void> toggleAccess(BuildContext context) async {
|
||||
onChange(String key) async {
|
||||
await StorageHelper.instance.set(SecureStorageKey.accessPass.value, key, Storage.SecureStorage);
|
||||
await PhpGroup.changePass.call(newSenha: key).then((value) async {
|
||||
final String content;
|
||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true', Storage.SQLiteStorage);
|
||||
notifyListeners();
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Access pass changed successfully',
|
||||
ptText: 'Senha de acesso alterada com sucesso',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de acesso',
|
||||
enText: 'Error changing access pass',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
}).catchError((e, s) {
|
||||
final String content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de acesso',
|
||||
enText: 'Error changing access pass',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async => isAccess = await StorageHelper.instance.get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
await PhpGroup.changePass
|
||||
.call(newSenha: key)
|
||||
.then((value) async {
|
||||
final String content;
|
||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true', Storage.SQLiteStorage);
|
||||
notifyListeners();
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Access pass changed successfully',
|
||||
ptText: 'Senha de acesso alterada com sucesso',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de acesso',
|
||||
enText: 'Error changing access pass',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
})
|
||||
.catchError((e, s) {
|
||||
final String content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de acesso',
|
||||
enText: 'Error changing access pass',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async => isAccess =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
}
|
||||
|
||||
_showPassKey(context, onChange);
|
||||
|
@ -133,31 +143,34 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
await PhpGroup.changePanic
|
||||
.call(newSenhaPanico: key)
|
||||
.then((value) async {
|
||||
final String content;
|
||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true', Storage.SQLiteStorage);
|
||||
notifyListeners();
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Panic password changed successfully',
|
||||
ptText: 'Senha de pânico alterada com sucesso',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de pânico',
|
||||
enText: 'Error changing panic password',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
}).catchError((e, s) {
|
||||
final String content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de pânico',
|
||||
enText: 'Error changing panic password',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async => isPanic = await StorageHelper.instance.get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
final String content;
|
||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true', Storage.SQLiteStorage);
|
||||
notifyListeners();
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Panic password changed successfully',
|
||||
ptText: 'Senha de pânico alterada com sucesso',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
} else {
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de pânico',
|
||||
enText: 'Error changing panic password',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
})
|
||||
.catchError((e, s) {
|
||||
final String content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao alterar senha de pânico',
|
||||
enText: 'Error changing panic password',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
})
|
||||
.then((_) async =>
|
||||
isPanic = await StorageHelper.instance.get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true')
|
||||
.whenComplete(() => notifyListeners());
|
||||
}
|
||||
|
||||
_showPassKey(context, onChange);
|
||||
|
@ -169,15 +182,15 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
ptText: 'Impressão digital alterada com sucesso',
|
||||
);
|
||||
|
||||
|
||||
onChange(String? key) async {
|
||||
isFingerprint = !isFingerprint;
|
||||
await StorageHelper.instance.set(SecureStorageKey.fingerprintPass.value, key ?? '', Storage.SecureStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
notifyListeners();
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
isFingerprint = await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
|
||||
isFingerprint =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
}
|
||||
|
||||
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
||||
|
@ -249,7 +262,4 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}).whenComplete(() => notifyListeners());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||
|
@ -17,7 +16,6 @@ class PreferencesPageWidget extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
|
|
@ -11,8 +11,6 @@ import 'package:qr_flutter/qr_flutter.dart';
|
|||
class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||
/// Local state fields for this page.
|
||||
|
||||
|
||||
|
||||
String? key;
|
||||
|
||||
DateTime? time;
|
||||
|
@ -31,7 +29,8 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
|||
}
|
||||
|
||||
Future<void> initVariable() async {
|
||||
isFingerprint = await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
isFingerprint =
|
||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||
userDevUUID = await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage) ?? '';
|
||||
safeSetState?.call();
|
||||
}
|
||||
|
@ -83,7 +82,6 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
|||
packet.add(check);
|
||||
}
|
||||
|
||||
|
||||
return Uint8List.fromList(packet);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
|||
animationsMap.values.where((anim) => anim.trigger == AnimationTrigger.onActionTrigger || !anim.applyInitialState),
|
||||
this,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -127,7 +126,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
|||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
_resetAnimationAndToggleAccess();
|
||||
_resetAnimationAndToggleAccess();
|
||||
log('isFingerprint: ${_model.isFingerprint}');
|
||||
_model.isFingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context);
|
||||
},
|
||||
|
@ -325,20 +324,21 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
|||
Future<void> _showBiometricsAuth(BuildContext context) async {
|
||||
await BiometricHelper.checkBiometrics()
|
||||
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
|
||||
final key = await StorageHelper.instance.get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? '';
|
||||
safeSetState(() {
|
||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse();
|
||||
}
|
||||
_model.isAccess = !_model.isAccess;
|
||||
_model.key = key;
|
||||
});
|
||||
final key =
|
||||
await StorageHelper.instance.get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? '';
|
||||
safeSetState(() {
|
||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse();
|
||||
}
|
||||
_model.isAccess = !_model.isAccess;
|
||||
_model.key = key;
|
||||
});
|
||||
}))
|
||||
.onError((error, stackTrace) {
|
||||
log('Error', error: error, stackTrace: stackTrace);
|
||||
if (mounted) _showQrCodeBottomSheet(context);
|
||||
});
|
||||
log('Error', error: error, stackTrace: stackTrace);
|
||||
if (mounted) _showQrCodeBottomSheet(context);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _showQrCodeBottomSheet(BuildContext context) async {
|
||||
|
@ -369,7 +369,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
|||
),
|
||||
);
|
||||
},
|
||||
).catchError((error) => safeSetState(() => _resetAnimationAndToggleAccess()));
|
||||
).catchError((error) => safeSetState(() => _resetAnimationAndToggleAccess()));
|
||||
unawaited(
|
||||
() async {
|
||||
await _model.qrCodeEncoder(context, key: _model.key);
|
||||
|
|
|
@ -6,7 +6,8 @@ import 'package:share_plus/share_plus.dart';
|
|||
|
||||
class ReceptionPageModel with ChangeNotifier {
|
||||
Future<void> getIdenfifier(BuildContext context) async {
|
||||
final String userDevUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final String userDevUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
notifyListeners();
|
||||
Share.share(
|
||||
|
|
|
@ -23,10 +23,14 @@ class _ReservationPageWidgetState extends State<ReservationPageWidget> {
|
|||
|
||||
Future<Map<String, String>> initVariables() async {
|
||||
final email = (await StorageHelper.instance.get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
||||
final name = (await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final devUUID = (await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID = (await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final clientId = (await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final name =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final devUUID =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
final clientId =
|
||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||
const createdAt = '0000-00-00 00:00:00';
|
||||
|
||||
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
|
||||
|
|
|
@ -234,9 +234,12 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
|
|||
],
|
||||
onTapCardItemAction: () async {
|
||||
final devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
final userUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
final cliName =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
|
||||
await showDialog(
|
||||
useSafeArea: true,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
abstract class BaseStorage {
|
||||
|
||||
Future<void> init();
|
||||
|
||||
Future<void> set(String key, String value);
|
||||
|
@ -141,4 +140,4 @@ extension SQLIteStorageKeyExtension on SQLiteStorageKey {
|
|||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
|
||||
class SecureStorage extends ChangeNotifier implements BaseStorage {
|
||||
|
||||
SecureStorage._();
|
||||
|
||||
static final SecureStorage instance = SecureStorage._();
|
||||
|
@ -37,5 +36,4 @@ class SecureStorage extends ChangeNotifier implements BaseStorage {
|
|||
await _secureStorage.deleteAll();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:hub/shared/helpers/base_storage.dart';
|
|||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class SharedPreferencesStorage extends ChangeNotifier implements BaseStorage {
|
||||
|
||||
SharedPreferencesStorage._();
|
||||
|
||||
static final SharedPreferencesStorage instance = SharedPreferencesStorage._();
|
||||
|
@ -37,5 +36,4 @@ class SharedPreferencesStorage extends ChangeNotifier implements BaseStorage {
|
|||
await _prefs.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
@ -6,7 +5,6 @@ import 'package:sqflite/sqlite_api.dart';
|
|||
import 'package:path/path.dart';
|
||||
|
||||
class SQLiteStorage extends ChangeNotifier implements BaseStorage {
|
||||
|
||||
SQLiteStorage._();
|
||||
|
||||
final String _dbName = 'database.db';
|
||||
|
@ -62,26 +60,26 @@ class SQLiteStorage extends ChangeNotifier implements BaseStorage {
|
|||
''';
|
||||
|
||||
List<Map<String, dynamic>> get _localVariables => [
|
||||
{'key': SQLiteStorageKey.devUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userDevUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.status.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userName.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.clientUUID.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.ownerUUID.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.clientName.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.whatsapp.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.provisional.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.pets.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.local.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.notify.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.fingerprint.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.access.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.panic.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.person.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.requestOSNotification.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.petAmount.value, 'value': '', 'type': 'local'},
|
||||
];
|
||||
{'key': SQLiteStorageKey.devUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userDevUUID.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.status.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.userName.value, 'value': '', 'type': 'user'},
|
||||
{'key': SQLiteStorageKey.clientUUID.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.ownerUUID.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.clientName.value, 'value': '', 'type': 'local'},
|
||||
{'key': SQLiteStorageKey.whatsapp.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.provisional.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.pets.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.local.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.notify.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.fingerprint.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.access.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.panic.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.person.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.requestOSNotification.value, 'value': 'false', 'type': 'util'},
|
||||
{'key': SQLiteStorageKey.petAmount.value, 'value': '', 'type': 'local'},
|
||||
];
|
||||
|
||||
@override
|
||||
Future<String?> get(String key) async {
|
||||
|
@ -107,8 +105,7 @@ class SQLiteStorage extends ChangeNotifier implements BaseStorage {
|
|||
'resolvedAt': date,
|
||||
'createdAt': date,
|
||||
},
|
||||
conflictAlgorithm: ConflictAlgorithm.replace
|
||||
);
|
||||
conflictAlgorithm: ConflictAlgorithm.replace);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
@ -128,5 +125,4 @@ class SQLiteStorage extends ChangeNotifier implements BaseStorage {
|
|||
await _database.delete('keychain');
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,5 +77,4 @@ class StorageHelper {
|
|||
return SQLiteStorage.instance.clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,8 @@ class AuthenticationService {
|
|||
final ApiCallResponse? response;
|
||||
final LoginCall callback = PhpGroup.loginCall;
|
||||
String deviceDescription = randomString(10, 10, true, false, false);
|
||||
await StorageHelper.instance.set(SecureStorageKey.deviceDescription.value, deviceDescription, Storage.SecureStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SecureStorageKey.deviceDescription.value, deviceDescription, Storage.SecureStorage);
|
||||
|
||||
final String? devUUID;
|
||||
final String userUUID;
|
||||
|
|
|
@ -207,7 +207,8 @@ class LocalizationService {
|
|||
log('() => isUnavailable');
|
||||
try {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, locals[0]['CLI_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, locals[0]['CLI_NOME'], Storage.SQLiteStorage);
|
||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
||||
if (response.jsonBody['error'] == true) {
|
||||
|
@ -257,7 +258,8 @@ class LocalizationService {
|
|||
static Future<bool> _isUnselected() async {
|
||||
String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
String cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||
String ownerUUID = (await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
String ownerUUID =
|
||||
(await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
||||
}
|
||||
|
||||
|
@ -274,11 +276,19 @@ class LocalizationService {
|
|||
}
|
||||
|
||||
static Future<void> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.provisional.value, jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.petAmount.value, jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty ? '0' : jsonBody['petAmountRegister'].toString(), Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage);
|
||||
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.whatsapp.value,
|
||||
jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.provisional.value,
|
||||
jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(SQLiteStorageKey.pets.value,
|
||||
jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||
await StorageHelper.instance.set(
|
||||
SQLiteStorageKey.petAmount.value,
|
||||
jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty
|
||||
? '0'
|
||||
: jsonBody['petAmountRegister'].toString(),
|
||||
Storage.SQLiteStorage);
|
||||
await StorageHelper.instance
|
||||
.set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue