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