debit: refatoração do database storage~
This commit is contained in:
parent
7a2ea2b2b4
commit
4391efaeaf
|
@ -92,9 +92,9 @@ class TestCall {
|
||||||
class GetLicense {
|
class GetLicense {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLicense',
|
callName: 'getLicense',
|
||||||
|
@ -123,8 +123,8 @@ class GetLicense {
|
||||||
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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
|
@ -151,9 +151,9 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'excluirPet';
|
const String atividade = 'excluirPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -196,9 +196,9 @@ class UpdatePet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'atualizarPet';
|
const String atividade = 'atualizarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -242,9 +242,9 @@ class GetPets {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'consultaPets';
|
const String atividade = 'consultaPets';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -276,9 +276,9 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'consultaFotoPet';
|
const String atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -319,9 +319,9 @@ class RegisterPet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cadastrarPet';
|
const String atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -364,9 +364,9 @@ class BuscaEnconcomendas {
|
||||||
final String? adresseeType,
|
final String? adresseeType,
|
||||||
final String? status,
|
final String? status,
|
||||||
}) async {
|
}) async {
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getEncomendas';
|
const String atividade = 'getEncomendas';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
@ -408,9 +408,9 @@ class CancelaVisita {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -442,8 +442,8 @@ class CancelaVisita {
|
||||||
|
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -474,9 +474,9 @@ class ChangePanic {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -510,9 +510,9 @@ class ChangePass {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -546,9 +546,9 @@ class RespondeVinculo {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
|
@ -580,9 +580,9 @@ class ChangeNotifica {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -614,10 +614,10 @@ class UpdateIDE {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
final String newIde = (await StorageHelper().g(SQLiteStorageKey.userDevUUID.value)) ?? '';
|
final String newIde = (await StorageHelper().g(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -649,8 +649,8 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String token = (await StorageHelper().g(SecureStorageKey.token.value)) ?? '';
|
final String token = (await StorageHelper().g(SecureStorageKey.token.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -678,7 +678,7 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String email = (await StorageHelper().g(SecureStorageKey.email.value)) ?? '';
|
final String email = (await StorageHelper().g(SecureStorageKey.email.value)) ?? '';
|
||||||
final String password = (await StorageHelper().g(SecureStorageKey.password.value)) ?? '';
|
final String password = (await StorageHelper().g(SecureStorageKey.password.value)) ?? '';
|
||||||
final String type = (await StorageHelper().g(SecureStorageKey.deviceType.value)) ?? '';
|
final String type = (await StorageHelper().g(SecureStorageKey.deviceType.value)) ?? '';
|
||||||
|
@ -765,9 +765,9 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePassword',
|
callName: 'changePassword',
|
||||||
|
@ -826,8 +826,8 @@ 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().g(SQLiteStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
final String userUUID = await StorageHelper().g(SQLiteStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLocals',
|
callName: 'getLocals',
|
||||||
|
@ -866,9 +866,9 @@ class PostScheduleVisitorCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putVisitante';
|
const String atividade = 'putVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -921,9 +921,9 @@ class PostScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putVisita';
|
const String atividade = 'putVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -975,9 +975,9 @@ class GetScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1249,9 +1249,9 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getDados';
|
const String atividade = 'getDados';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1482,9 +1482,9 @@ class GetVisitorByDocCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitante';
|
const String atividade = 'getVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1536,9 +1536,9 @@ class GetFotoVisitanteCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getFotoVisitante';
|
const String atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1575,9 +1575,9 @@ class PostProvVisitSchedulingCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putAgendamentoProv';
|
const String atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1624,9 +1624,9 @@ class GetVisitsCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1887,9 +1887,9 @@ class DeleteVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1930,10 +1930,10 @@ 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().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String ownerUUID = (await StorageHelper().g(SQLiteStorageKey.ownerUUID.value)) ?? '';
|
final String ownerUUID = (await StorageHelper().g(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
|
@ -1996,9 +1996,9 @@ class RespondeSolicitacaoCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'respondeSolicitacao';
|
const String atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2046,9 +2046,9 @@ class GetAccessCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getAcessos';
|
const String atividade = 'getAcessos';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2295,9 +2295,9 @@ class GetLiberationsCall {
|
||||||
final StreamController<ApiCallResponse> controller = StreamController();
|
final StreamController<ApiCallResponse> controller = StreamController();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getSolicitacoes';
|
const String atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2487,9 +2487,9 @@ class GetMessagesCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getMensagens';
|
const String atividade = 'getMensagens';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
|
|
@ -15,7 +15,7 @@ import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||||
|
|
||||||
final cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
answersRequest(
|
answersRequest(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
|
@ -271,11 +271,11 @@ class NotificationService {
|
||||||
|
|
||||||
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||||
final bool requestOSnotification =
|
final bool requestOSnotification =
|
||||||
(await StorageHelper().g(SQLiteStorageKey.requestOSNotification.value)) == 'true';
|
(await StorageHelper().g(KeychainStorageKey.requestOSNotification.value)) == 'true';
|
||||||
|
|
||||||
if (requestOSnotification == false) {
|
if (requestOSnotification == false) {
|
||||||
if (isAllowed == false) {
|
if (isAllowed == false) {
|
||||||
await StorageHelper().s(SQLiteStorageKey.requestOSNotification.value, 'true');
|
await StorageHelper().s(KeychainStorageKey.requestOSNotification.value, 'true');
|
||||||
await AwesomeNotifications().requestPermissionToSendNotifications();
|
await AwesomeNotifications().requestPermissionToSendNotifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,9 +105,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
|
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().s(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
return widget.response;
|
return widget.response;
|
||||||
|
@ -137,7 +137,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
|
|
||||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
try {
|
try {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, cliID);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, cliID);
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -147,7 +147,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -195,9 +195,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().s(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -18,8 +18,8 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
setStateCallback?.call();
|
setStateCallback?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
await LocalizationService.processLocals(context).whenComplete(() => onUpdate());
|
await LocalizationService.processLocals(context).whenComplete(() => onUpdate());
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
|
|
|
@ -60,7 +60,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openDeliverySchedule(BuildContext context) async {
|
Future openDeliverySchedule(BuildContext context) async {
|
||||||
final bool isProvisional = await StorageHelper().g(SQLiteStorageKey.provisional.value) == 'true';
|
final bool isProvisional = await StorageHelper().g(KeychainStorageKey.provisional.value) == 'true';
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
'/deliverySchedule',
|
'/deliverySchedule',
|
||||||
|
@ -78,7 +78,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openProvisionalSchedule(BuildContext context) async {
|
Future openProvisionalSchedule(BuildContext context) async {
|
||||||
final isProvisional = await StorageHelper().g(SQLiteStorageKey.provisional.value) == 'true';
|
final isProvisional = await StorageHelper().g(KeychainStorageKey.provisional.value) == 'true';
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
'/provisionalSchedule',
|
'/provisionalSchedule',
|
||||||
|
@ -96,7 +96,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openFastPassSchedule(BuildContext context) async {
|
Future openFastPassSchedule(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper().g(SQLiteStorageKey.whatsapp.value) == 'true';
|
final isWpp = await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true';
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
'/fastPassPage',
|
'/fastPassPage',
|
||||||
|
@ -205,7 +205,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openMyOrders(BuildContext context) async {
|
Future openMyOrders(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper().g(SQLiteStorageKey.whatsapp.value) == 'true';
|
final isWpp = await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true';
|
||||||
;
|
;
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -224,7 +224,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openReservations(BuildContext context) async {
|
Future openReservations(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper().g(SQLiteStorageKey.whatsapp.value) == 'true';
|
final isWpp = await StorageHelper().g(KeychainStorageKey.whatsapp.value) == 'true';
|
||||||
;
|
;
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -341,7 +341,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openPetsRegister(BuildContext context) async {
|
Future openPetsRegister(BuildContext context) async {
|
||||||
bool isPet = await StorageHelper().g(SQLiteStorageKey.pets.value) == 'true';
|
bool isPet = await StorageHelper().g(KeychainStorageKey.pets.value) == 'true';
|
||||||
;
|
;
|
||||||
if (isPet) {
|
if (isPet) {
|
||||||
context.push(
|
context.push(
|
||||||
|
|
|
@ -56,9 +56,9 @@ class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidge
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -16,10 +16,10 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -32,9 +32,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -27,9 +27,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,12 +138,12 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
ownerUUID = (await StorageHelper().g(SQLiteStorageKey.ownerUUID.value)) ?? '';
|
ownerUUID = (await StorageHelper().g(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
setState?.call();
|
setState?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,9 +129,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,9 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
future: () async {
|
future: () async {
|
||||||
final bool isLogged = await StorageHelper().g(SecureStorageKey.isLogged.value) == 'true';
|
final bool isLogged = await StorageHelper().g(SecureStorageKey.isLogged.value) == 'true';
|
||||||
final bool haveLocal = await StorageHelper().g(SecureStorageKey.haveLocal.value) == 'true';
|
final bool haveLocal = await StorageHelper().g(SecureStorageKey.haveLocal.value) == 'true';
|
||||||
final bool haveUserUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value))?.isNotEmpty ?? false;
|
final bool haveUserUUID =
|
||||||
final bool haveDevUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value))?.isNotEmpty ?? false;
|
(await StorageHelper().g(KeychainStorageKey.userUUID.value))?.isNotEmpty ?? false;
|
||||||
|
final bool haveDevUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value))?.isNotEmpty ?? false;
|
||||||
|
|
||||||
if (isLogged && haveDevUUID && haveUserUUID) {
|
if (isLogged && haveDevUUID && haveUserUUID) {
|
||||||
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
||||||
|
|
|
@ -21,7 +21,6 @@ import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
import 'package:hub/shared/services/localization/localization_service.dart';
|
||||||
import 'package:hub/shared/utils/device_util.dart';
|
|
||||||
import 'package:responsive_framework/responsive_framework.dart';
|
import 'package:responsive_framework/responsive_framework.dart';
|
||||||
|
|
||||||
import 'backend/notifications/firebase_messaging_service.dart';
|
import 'backend/notifications/firebase_messaging_service.dart';
|
||||||
|
|
|
@ -33,9 +33,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -24,10 +24,10 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = (await StorageHelper().g(hub.SecureStorageKey.email.value)) ?? '';
|
final email = (await StorageHelper().g(hub.SecureStorageKey.email.value)) ?? '';
|
||||||
final name = (await StorageHelper().g(hub.SQLiteStorageKey.userName.value)) ?? '';
|
final name = (await StorageHelper().g(hub.KeychainStorageKey.userName.value)) ?? '';
|
||||||
final devUUID = (await StorageHelper().g(hub.SQLiteStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().g(hub.KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = (await StorageHelper().g(hub.SQLiteStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().g(hub.KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().g(hub.SQLiteStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().g(hub.KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
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 =
|
||||||
|
|
|
@ -24,10 +24,10 @@ class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
||||||
late MessageWellComponentModel messageWellComponentModel;
|
late MessageWellComponentModel messageWellComponentModel;
|
||||||
|
|
||||||
Future<void> _initVariable() async {
|
Future<void> _initVariable() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
userName = (await StorageHelper().g(SQLiteStorageKey.userName.value)) ?? '';
|
userName = (await StorageHelper().g(KeychainStorageKey.userName.value)) ?? '';
|
||||||
userEmail = (await StorageHelper().g(SecureStorageKey.email.value)) ?? '';
|
userEmail = (await StorageHelper().g(SecureStorageKey.email.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@ class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future answersRequest(
|
Future answersRequest(
|
||||||
|
|
|
@ -39,9 +39,9 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -64,7 +64,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -229,10 +229,10 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
final cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
final cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -144,10 +144,10 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
textControllerObservation = TextEditingController();
|
textControllerObservation = TextEditingController();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
devUUID = await StorageHelper().g(SQLiteStorageKey.devUUID.value) ?? '';
|
devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
userUUID = await StorageHelper().g(SQLiteStorageKey.userUUID.value) ?? '';
|
userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
cliUUID = await StorageHelper().g(SQLiteStorageKey.clientUUID.value) ?? '';
|
cliUUID = await StorageHelper().g(KeychainStorageKey.clientUUID.value) ?? '';
|
||||||
petAmountRegister = await StorageHelper().g(SQLiteStorageKey.petAmount.value) ?? '';
|
petAmountRegister = await StorageHelper().g(KeychainStorageKey.petAmount.value) ?? '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,11 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
late bool isPanic = false;
|
late bool isPanic = false;
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
isFingerprint = await StorageHelper().g(SQLiteStorageKey.fingerprint.value) == 'true';
|
isFingerprint = await StorageHelper().g(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
isPerson = await StorageHelper().g(SQLiteStorageKey.person.value) == 'true';
|
isPerson = await StorageHelper().g(KeychainStorageKey.person.value) == 'true';
|
||||||
isNotify = await StorageHelper().g(SQLiteStorageKey.notify.value) == 'true';
|
isNotify = await StorageHelper().g(KeychainStorageKey.notify.value) == 'true';
|
||||||
isAccess = await StorageHelper().g(SQLiteStorageKey.access.value) == 'true';
|
isAccess = await StorageHelper().g(KeychainStorageKey.access.value) == 'true';
|
||||||
isPanic = await StorageHelper().g(SQLiteStorageKey.panic.value) == 'true';
|
isPanic = await StorageHelper().g(KeychainStorageKey.panic.value) == 'true';
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> enablePerson(BuildContext context) async {
|
Future<void> enablePerson(BuildContext context) async {
|
||||||
final String userDevUUID = (await StorageHelper().g(SQLiteStorageKey.userDevUUID.value)) ?? '';
|
final String userDevUUID = (await StorageHelper().g(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -63,7 +63,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
.call(notifica: value)
|
.call(notifica: value)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
if (value.jsonBody['error'] == false) {
|
if (value.jsonBody['error'] == false) {
|
||||||
await StorageHelper().s(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true');
|
await StorageHelper().s(KeychainStorageKey.notify.value, isNotify ? 'false' : 'true');
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Notification changed successfully',
|
enText: 'Notification changed successfully',
|
||||||
ptText: 'Notificação alterada com sucesso',
|
ptText: 'Notificação alterada com sucesso',
|
||||||
|
@ -86,7 +86,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async => isNotify = await StorageHelper().g(SQLiteStorageKey.notify.value) == 'true')
|
.then((_) async => isNotify = await StorageHelper().g(KeychainStorageKey.notify.value) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
.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().s(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true');
|
await StorageHelper().s(KeychainStorageKey.access.value, isAccess ? 'false' : 'true');
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Access pass changed successfully',
|
enText: 'Access pass changed successfully',
|
||||||
|
@ -163,7 +163,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async => isAccess = await StorageHelper().g(SQLiteStorageKey.access.value) == 'true')
|
.then((_) async => isAccess = await StorageHelper().g(KeychainStorageKey.access.value) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
.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().s(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true');
|
await StorageHelper().s(KeychainStorageKey.panic.value, isPanic ? 'false' : 'true');
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Panic password changed successfully',
|
enText: 'Panic password changed successfully',
|
||||||
|
@ -200,7 +200,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async => isPanic = await StorageHelper().g(SQLiteStorageKey.panic.value) == 'true')
|
.then((_) async => isPanic = await StorageHelper().g(KeychainStorageKey.panic.value) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,10 +216,10 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
onChange(String? key) async {
|
onChange(String? key) async {
|
||||||
isFingerprint = !isFingerprint;
|
isFingerprint = !isFingerprint;
|
||||||
await StorageHelper().s(SecureStorageKey.fingerprintPass.value, key ?? '');
|
await StorageHelper().s(SecureStorageKey.fingerprintPass.value, key ?? '');
|
||||||
await StorageHelper().s(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false');
|
await StorageHelper().s(KeychainStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false');
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
isFingerprint = await StorageHelper().g(SQLiteStorageKey.fingerprint.value) == 'true';
|
isFingerprint = await StorageHelper().g(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
||||||
|
|
|
@ -29,8 +29,8 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initVariable() async {
|
Future<void> initVariable() async {
|
||||||
isFingerprint = await StorageHelper().g(SQLiteStorageKey.fingerprint.value) == 'true';
|
isFingerprint = await StorageHelper().g(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
userDevUUID = await StorageHelper().g(SQLiteStorageKey.userDevUUID.value) ?? '';
|
userDevUUID = await StorageHelper().g(KeychainStorageKey.userDevUUID.value) ?? '';
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ 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().g(SQLiteStorageKey.userDevUUID.value)) ?? '';
|
final String userDevUUID = (await StorageHelper().g(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
|
|
|
@ -23,10 +23,10 @@ class _ReservationPageWidgetState extends State<ReservationPageWidget> {
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = (await StorageHelper().g(hub.SecureStorageKey.email.value)) ?? '';
|
final email = (await StorageHelper().g(hub.SecureStorageKey.email.value)) ?? '';
|
||||||
final name = (await StorageHelper().g(hub.SQLiteStorageKey.userName.value)) ?? '';
|
final name = (await StorageHelper().g(hub.KeychainStorageKey.userName.value)) ?? '';
|
||||||
final devUUID = (await StorageHelper().g(hub.SQLiteStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().g(hub.KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = (await StorageHelper().g(hub.SQLiteStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().g(hub.KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final clientId = (await StorageHelper().g(hub.SQLiteStorageKey.clientUUID.value)) ?? '';
|
final clientId = (await StorageHelper().g(hub.KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
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';
|
||||||
|
|
|
@ -215,9 +215,9 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel<ScheduleComplete>
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initVariables() async {
|
Future<void> _initVariables() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -35,9 +35,9 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
|
||||||
List<dynamic> _visitWrap = [];
|
List<dynamic> _visitWrap = [];
|
||||||
|
|
||||||
Future<void> _initVariables() async {
|
Future<void> _initVariables() async {
|
||||||
devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -245,10 +245,10 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final devUUID = (await StorageHelper().g(SQLiteStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = (await StorageHelper().g(SQLiteStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
final cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
final cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
|
|
|
@ -14,8 +14,6 @@ enum Storage {
|
||||||
secureStorage,
|
secureStorage,
|
||||||
sharedPreferences,
|
sharedPreferences,
|
||||||
databaseStorage,
|
databaseStorage,
|
||||||
sqliteStorage,
|
|
||||||
licenseStorage,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SharedPreferencesKey {
|
enum SharedPreferencesKey {
|
||||||
|
@ -75,7 +73,7 @@ extension SecureStorageKeyExtension on SecureStorageKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SQLiteStorageKey {
|
enum KeychainStorageKey {
|
||||||
devUUID,
|
devUUID,
|
||||||
userUUID,
|
userUUID,
|
||||||
userDevUUID,
|
userDevUUID,
|
||||||
|
@ -97,46 +95,46 @@ enum SQLiteStorageKey {
|
||||||
requestOSNotification,
|
requestOSNotification,
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SQLIteStorageKeyExtension on SQLiteStorageKey {
|
extension KeychainStorageKeyExtension on KeychainStorageKey {
|
||||||
String get value {
|
String get value {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case SQLiteStorageKey.devUUID:
|
case KeychainStorageKey.devUUID:
|
||||||
return 'fre_devUUID';
|
return 'fre_devUUID';
|
||||||
case SQLiteStorageKey.userUUID:
|
case KeychainStorageKey.userUUID:
|
||||||
return 'fre_userUUID';
|
return 'fre_userUUID';
|
||||||
case SQLiteStorageKey.userDevUUID:
|
case KeychainStorageKey.userDevUUID:
|
||||||
return 'fre_userDevUUID';
|
return 'fre_userDevUUID';
|
||||||
case SQLiteStorageKey.status:
|
case KeychainStorageKey.status:
|
||||||
return 'fre_status';
|
return 'fre_status';
|
||||||
case SQLiteStorageKey.userName:
|
case KeychainStorageKey.userName:
|
||||||
return 'fre_userName';
|
return 'fre_userName';
|
||||||
case SQLiteStorageKey.clientUUID:
|
case KeychainStorageKey.clientUUID:
|
||||||
return 'fre_cliUUID';
|
return 'fre_cliUUID';
|
||||||
case SQLiteStorageKey.ownerUUID:
|
case KeychainStorageKey.ownerUUID:
|
||||||
return 'fre_ownerUUID';
|
return 'fre_ownerUUID';
|
||||||
case SQLiteStorageKey.clientName:
|
case KeychainStorageKey.clientName:
|
||||||
return 'fre_cliName';
|
return 'fre_cliName';
|
||||||
case SQLiteStorageKey.petAmount:
|
case KeychainStorageKey.petAmount:
|
||||||
return 'fre_petAmountRegister';
|
return 'fre_petAmountRegister';
|
||||||
case SQLiteStorageKey.whatsapp:
|
case KeychainStorageKey.whatsapp:
|
||||||
return 'fre_whatsapp';
|
return 'fre_whatsapp';
|
||||||
case SQLiteStorageKey.provisional:
|
case KeychainStorageKey.provisional:
|
||||||
return 'fre_provisional';
|
return 'fre_provisional';
|
||||||
case SQLiteStorageKey.pets:
|
case KeychainStorageKey.pets:
|
||||||
return 'fre_pets';
|
return 'fre_pets';
|
||||||
case SQLiteStorageKey.local:
|
case KeychainStorageKey.local:
|
||||||
return 'fre_local';
|
return 'fre_local';
|
||||||
case SQLiteStorageKey.notify:
|
case KeychainStorageKey.notify:
|
||||||
return 'fre_notify';
|
return 'fre_notify';
|
||||||
case SQLiteStorageKey.fingerprint:
|
case KeychainStorageKey.fingerprint:
|
||||||
return 'fre_fingerprint';
|
return 'fre_fingerprint';
|
||||||
case SQLiteStorageKey.access:
|
case KeychainStorageKey.access:
|
||||||
return 'fre_access';
|
return 'fre_access';
|
||||||
case SQLiteStorageKey.panic:
|
case KeychainStorageKey.panic:
|
||||||
return 'fre_panic';
|
return 'fre_panic';
|
||||||
case SQLiteStorageKey.person:
|
case KeychainStorageKey.person:
|
||||||
return 'fre_person';
|
return 'fre_person';
|
||||||
case SQLiteStorageKey.requestOSNotification:
|
case KeychainStorageKey.requestOSNotification:
|
||||||
return 'fre_requestOSnotification';
|
return 'fre_requestOSnotification';
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/services/keychain/keychain_database_delegate.dart';
|
||||||
|
import 'package:hub/shared/services/keychain/keychain_service.dart';
|
||||||
|
import 'package:hub/shared/services/license/license_database_delegate.dart';
|
||||||
import 'package:hub/shared/services/license/license_service.dart';
|
import 'package:hub/shared/services/license/license_service.dart';
|
||||||
import 'package:hub/shared/services/sqlite/sqlite_service.dart';
|
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
class DatabaseStorage {
|
class DatabaseStorage implements BaseStorage {
|
||||||
static final String _dbName = 'database.db';
|
static final String _dbName = 'database.db';
|
||||||
static final int _dbVersion = 2;
|
static final int _dbVersion = 2;
|
||||||
|
|
||||||
|
@ -15,6 +18,16 @@ class DatabaseStorage {
|
||||||
static late final Database _database;
|
static late final Database _database;
|
||||||
static Database get database => _database;
|
static Database get database => _database;
|
||||||
|
|
||||||
|
static BaseStorage getInstanceByKey(String key) {
|
||||||
|
if (KeychainStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
||||||
|
return KeychainDelegate.instance;
|
||||||
|
}
|
||||||
|
if (LicenseStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
||||||
|
return LicenseDelegate.instance;
|
||||||
|
}
|
||||||
|
throw Exception('Storage not found');
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
_database = await openDatabase(
|
_database = await openDatabase(
|
||||||
join(await getDatabasesPath(), _dbName),
|
join(await getDatabasesPath(), _dbName),
|
||||||
|
@ -27,18 +40,40 @@ class DatabaseStorage {
|
||||||
|
|
||||||
Future<void> _onCreate(Database database, int version) async {
|
Future<void> _onCreate(Database database, int version) async {
|
||||||
log('Creating database...');
|
log('Creating database...');
|
||||||
await database.execute(SQLiteStorage.createTableQuery);
|
await database.execute(KeychainDelegate.createTableQuery);
|
||||||
await database.execute(LicenseService.createTableQuery);
|
await database.execute(LicenseDelegate.createTableQuery);
|
||||||
await LicenseService.setupLicense();
|
await LicenseService.setupLicense();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onUpgrade(Database database, int oldVersion, int newVersion) async {
|
Future<void> _onUpgrade(Database database, int oldVersion, int newVersion) async {
|
||||||
log('Upgrading database from version $oldVersion to $newVersion...');
|
log('Upgrading database from version $oldVersion to $newVersion...');
|
||||||
if (oldVersion < 2) {
|
if (oldVersion < 2) {
|
||||||
await database.execute(LicenseService.createTableQuery);
|
await database.execute(LicenseDelegate.createTableQuery);
|
||||||
await LicenseService.setupLicense();
|
await LicenseService.setupLicense();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onDowngrade(Database database, int oldVersion, int newVersion) async {}
|
Future<void> _onDowngrade(Database database, int oldVersion, int newVersion) async {}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> clearAll() async {
|
||||||
|
await _database.delete(KeychainDelegate.tableKeychain);
|
||||||
|
await _database.delete(LicenseDelegate.tableLicense);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> delete(String key) async {
|
||||||
|
return await getInstanceByKey(key).delete(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<String?> get(String key) async {
|
||||||
|
return await getInstanceByKey(key).get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> set(String key, String value) async {
|
||||||
|
return await getInstanceByKey(key).set(key, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/database_storage.dart';
|
import 'package:hub/shared/helpers/database_storage.dart';
|
||||||
import 'package:hub/shared/helpers/secure_storage.dart';
|
import 'package:hub/shared/helpers/secure_storage.dart';
|
||||||
import 'package:hub/shared/helpers/shared_preferences_storage.dart';
|
import 'package:hub/shared/helpers/shared_preferences_storage.dart';
|
||||||
|
import 'package:hub/shared/services/keychain/keychain_service.dart';
|
||||||
import 'package:hub/shared/services/license/license_service.dart';
|
import 'package:hub/shared/services/license/license_service.dart';
|
||||||
import 'package:hub/shared/services/sqlite/sqlite_service.dart';
|
|
||||||
|
|
||||||
class StorageHelper {
|
class StorageHelper {
|
||||||
static final StorageHelper _instance = StorageHelper._internal();
|
static final StorageHelper _instance = StorageHelper._internal();
|
||||||
|
@ -38,104 +38,34 @@ class StorageHelper {
|
||||||
return SecureStorage.instance;
|
return SecureStorage.instance;
|
||||||
case Storage.sharedPreferences:
|
case Storage.sharedPreferences:
|
||||||
return SharedPreferencesStorage.instance;
|
return SharedPreferencesStorage.instance;
|
||||||
case Storage.sqliteStorage:
|
|
||||||
return SQLiteStorage.instance;
|
|
||||||
case Storage.licenseStorage:
|
|
||||||
return LicenseService();
|
|
||||||
default:
|
default:
|
||||||
throw Exception('Storage not found');
|
return DatabaseStorage.instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BaseStorage getInstanceByKey(String key) {
|
static BaseStorage getInstanceByKey(String key) {
|
||||||
if (SecureStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
if (SecureStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
||||||
return SecureStorage.instance;
|
return SecureStorage.instance;
|
||||||
}
|
} else if (SharedPreferencesKey.values.map((e) => e.value).toList().contains(key)) {
|
||||||
if (SharedPreferencesKey.values.map((e) => e.value).toList().contains(key)) {
|
|
||||||
return SharedPreferencesStorage.instance;
|
return SharedPreferencesStorage.instance;
|
||||||
|
} else {
|
||||||
|
return DatabaseStorage.instance;
|
||||||
}
|
}
|
||||||
if (SQLiteStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
|
||||||
return SQLiteStorage.instance;
|
|
||||||
}
|
|
||||||
if (LicenseStorageKey.values.map((e) => e.value).toList().contains(key)) {
|
|
||||||
return LicenseService();
|
|
||||||
}
|
|
||||||
throw Exception('Key not found');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> g(String key) {
|
Future<String?> g(String key) async {
|
||||||
return getInstanceByKey(key).get(key);
|
return await getInstanceByKey(key).get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> s(String key, String value) {
|
Future<void> s(String key, String value) async {
|
||||||
return getInstanceByKey(key).set(key, value);
|
return await getInstanceByKey(key).set(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> d(String key) {
|
Future<void> d(String key) async {
|
||||||
return getInstanceByKey(key).delete(key);
|
return await getInstanceByKey(key).delete(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> c(Storage storage) {
|
Future<void> c(Storage storage) async {
|
||||||
return getInstance(storage).clearAll();
|
return await getInstance(storage).clearAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<String?> get(String key, Storage storage) {
|
|
||||||
// switch (storage) {
|
|
||||||
// case Storage.SecureStorage:
|
|
||||||
// return SecureStorage.instance.get(key);
|
|
||||||
// case Storage.SharedPreferences:
|
|
||||||
// return SharedPreferencesStorage.instance.get(key);
|
|
||||||
// case Storage.SQLiteStorage:
|
|
||||||
// return SQLiteStorage.instance.get(key);
|
|
||||||
// case Storage.LicenseStorage:
|
|
||||||
// return LicenseStorage.instance.get(key);
|
|
||||||
// default:
|
|
||||||
// throw Exception('Storage not found');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<void> set(String key, String value, Storage storage) {
|
|
||||||
// switch (storage) {
|
|
||||||
// case Storage.SecureStorage:
|
|
||||||
// return SecureStorage.instance.set(key, value);
|
|
||||||
// case Storage.SharedPreferences:
|
|
||||||
// return SharedPreferencesStorage.instance.set(key, value);
|
|
||||||
// case Storage.SQLiteStorage:
|
|
||||||
// return SQLiteStorage.instance.set(key, value);
|
|
||||||
// case Storage.LicenseStorage:
|
|
||||||
// return LicenseStorage.instance.set(key, value);
|
|
||||||
// default:
|
|
||||||
// throw Exception('Storage not found');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<void> delete(String key, Storage storage) {
|
|
||||||
// switch (storage) {
|
|
||||||
// case Storage.SecureStorage:
|
|
||||||
// return SecureStorage.instance.delete(key);
|
|
||||||
// case Storage.SharedPreferences:
|
|
||||||
// return SharedPreferencesStorage.instance.delete(key);
|
|
||||||
// case Storage.SQLiteStorage:
|
|
||||||
// return SQLiteStorage.instance.delete(key);
|
|
||||||
// case Storage.LicenseStorage:
|
|
||||||
// return LicenseStorage.instance.delete(key);
|
|
||||||
// default:
|
|
||||||
// throw Exception('Storage not found');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<void> clearAll(Storage storage) {
|
|
||||||
// switch (storage) {
|
|
||||||
// case Storage.SecureStorage:
|
|
||||||
// return SecureStorage.instance.clearAll();
|
|
||||||
// case Storage.SharedPreferences:
|
|
||||||
// return SharedPreferencesStorage.instance.clearAll();
|
|
||||||
// case Storage.SQLiteStorage:
|
|
||||||
// return SQLiteStorage.instance.clearAll();
|
|
||||||
// case Storage.LicenseStorage:
|
|
||||||
// return LicenseStorage.instance.clearAll();
|
|
||||||
// default:
|
|
||||||
// throw Exception('Storage not found');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class AuthenticationService {
|
||||||
if ((email != '') && (passwd != '')) {
|
if ((email != '') && (passwd != '')) {
|
||||||
await StorageHelper().s(SecureStorageKey.email.value, email);
|
await StorageHelper().s(SecureStorageKey.email.value, email);
|
||||||
await StorageHelper().s(SecureStorageKey.password.value, passwd);
|
await StorageHelper().s(SecureStorageKey.password.value, passwd);
|
||||||
await StorageHelper().s(SQLiteStorageKey.devUUID.value, devUUID!);
|
await StorageHelper().s(KeychainStorageKey.devUUID.value, devUUID!);
|
||||||
response = await callback.call();
|
response = await callback.call();
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -70,10 +70,10 @@ class AuthenticationService {
|
||||||
userDevUUID = response.jsonBody['user']['dev_id'];
|
userDevUUID = response.jsonBody['user']['dev_id'];
|
||||||
userName = response.jsonBody['user']['name'];
|
userName = response.jsonBody['user']['name'];
|
||||||
|
|
||||||
await StorageHelper().s(SQLiteStorageKey.userUUID.value, userUUID);
|
await StorageHelper().s(KeychainStorageKey.userUUID.value, userUUID);
|
||||||
await StorageHelper().s(SQLiteStorageKey.userDevUUID.value, userDevUUID);
|
await StorageHelper().s(KeychainStorageKey.userDevUUID.value, userDevUUID);
|
||||||
await StorageHelper().s(SQLiteStorageKey.status.value, status);
|
await StorageHelper().s(KeychainStorageKey.status.value, status);
|
||||||
await StorageHelper().s(SQLiteStorageKey.userName.value, userName);
|
await StorageHelper().s(KeychainStorageKey.userName.value, userName);
|
||||||
|
|
||||||
await login(context);
|
await login(context);
|
||||||
} else {
|
} else {
|
||||||
|
@ -138,7 +138,7 @@ class AuthenticationService {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
await StorageHelper().c(Storage.secureStorage);
|
await StorageHelper().c(Storage.secureStorage);
|
||||||
await StorageHelper().c(Storage.sqliteStorage);
|
await StorageHelper().c(Storage.databaseStorage);
|
||||||
context.go('/welcomePage', extra: extra);
|
context.go('/welcomePage', extra: extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import 'dart:convert';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
import 'dart:developer';
|
|
||||||
import 'package:hub/shared/helpers/database_storage.dart';
|
import 'package:hub/shared/helpers/database_storage.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
|
|
||||||
class SQLiteStorage implements BaseStorage {
|
class KeychainDelegate implements BaseStorage {
|
||||||
SQLiteStorage._();
|
KeychainDelegate._();
|
||||||
|
|
||||||
static final SQLiteStorage instance = SQLiteStorage._();
|
static final KeychainDelegate instance = KeychainDelegate._();
|
||||||
|
|
||||||
static const String tableKeychain = 'keychain';
|
static const String tableKeychain = 'keychain';
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
import 'package:hub/shared/helpers/database_storage.dart';
|
||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
|
||||||
|
class KeychainService {
|
||||||
|
static final KeychainService _instance = KeychainService._internal();
|
||||||
|
factory KeychainService() => _instance;
|
||||||
|
KeychainService._internal();
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/database_storage.dart';
|
||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
|
class LicenseDelegate implements BaseStorage {
|
||||||
|
LicenseDelegate._();
|
||||||
|
|
||||||
|
static final LicenseDelegate instance = LicenseDelegate._();
|
||||||
|
|
||||||
|
static const String tableLicense = 'license';
|
||||||
|
|
||||||
|
static String get createTableQuery => '''
|
||||||
|
CREATE TABLE $tableLicense (
|
||||||
|
key TEXT UNIQUE,
|
||||||
|
display TEXT,
|
||||||
|
expirationDate TEXT,
|
||||||
|
startDate TEXT,
|
||||||
|
quantity TEXT
|
||||||
|
);
|
||||||
|
''';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> init() async {
|
||||||
|
await DatabaseStorage.instance.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<String?> get(String key) async {
|
||||||
|
var response = await DatabaseStorage.database.query(tableLicense, where: 'key = ?', whereArgs: [key]);
|
||||||
|
if (response.isEmpty) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return response.first['value'].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> set(String key, String value) async {
|
||||||
|
log('setLicense($key, $value)');
|
||||||
|
Map<String, dynamic> valueMap = jsonDecode(value);
|
||||||
|
log('String to Map<String, dynamic>: $value to $valueMap');
|
||||||
|
|
||||||
|
await DatabaseStorage.database.insert(
|
||||||
|
tableLicense,
|
||||||
|
{
|
||||||
|
'key': key,
|
||||||
|
'display': valueMap['display'],
|
||||||
|
'expirationDate': valueMap['expirationDate'],
|
||||||
|
'startDate': valueMap['startDate'],
|
||||||
|
'quantity': valueMap['quantity'],
|
||||||
|
},
|
||||||
|
conflictAlgorithm: ConflictAlgorithm.replace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> delete(String key) async {
|
||||||
|
await DatabaseStorage.database.delete(tableLicense, where: 'key = ?', whereArgs: [key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> clearAll() async {
|
||||||
|
await DatabaseStorage.database.delete(tableLicense);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,30 +8,21 @@ import 'package:hub/shared/helpers/database_storage.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
import 'package:hub/shared/services/license/license_database_delegate.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
class LicenseService implements BaseStorage {
|
class LicenseService {
|
||||||
static final LicenseService _instance = LicenseService._internal();
|
static final LicenseService _instance = LicenseService._internal();
|
||||||
factory LicenseService() => _instance;
|
factory LicenseService() => _instance;
|
||||||
LicenseService._internal();
|
LicenseService._internal();
|
||||||
|
|
||||||
static const String tableLicense = 'license';
|
|
||||||
|
|
||||||
static String get createTableQuery => '''
|
|
||||||
CREATE TABLE $tableLicense (
|
|
||||||
key TEXT UNIQUE,
|
|
||||||
display TEXT,
|
|
||||||
expirationDate TEXT,
|
|
||||||
startDate TEXT,
|
|
||||||
quantity TEXT
|
|
||||||
);
|
|
||||||
''';
|
|
||||||
|
|
||||||
static Future<void> setupLicense() async {
|
static Future<void> setupLicense() async {
|
||||||
log('initLicense()');
|
log('initLicense()');
|
||||||
for (var element in LicenseStorageKey.values.map((e) => e.value)) {
|
for (var element in LicenseStorageKey.values.map((e) => e.value)) {
|
||||||
await DatabaseStorage.database.insert(
|
await DatabaseStorage.database.insert(
|
||||||
tableLicense,
|
LicenseDelegate.tableLicense,
|
||||||
{
|
{
|
||||||
'key': element,
|
'key': element,
|
||||||
'display': 'VISIVEL',
|
'display': 'VISIVEL',
|
||||||
|
@ -44,47 +35,6 @@ class LicenseService implements BaseStorage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> init() async {
|
|
||||||
await DatabaseStorage.instance.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<String?> get(String key) async {
|
|
||||||
var response = await DatabaseStorage.database.query(tableLicense, where: 'key = ?', whereArgs: [key]);
|
|
||||||
if (response.isEmpty) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return response.first['value'].toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> set(String key, String value) async {
|
|
||||||
log('setLicense($key, $value)');
|
|
||||||
Map<String, dynamic> valueMap = jsonDecode(value);
|
|
||||||
log('String to Map<String, dynamic>: $value to $valueMap');
|
|
||||||
|
|
||||||
await DatabaseStorage.database.insert(
|
|
||||||
tableLicense,
|
|
||||||
{
|
|
||||||
'key': key,
|
|
||||||
'display': valueMap['display'],
|
|
||||||
'expirationDate': valueMap['expirationDate'],
|
|
||||||
'startDate': valueMap['startDate'],
|
|
||||||
'quantity': valueMap['quantity'],
|
|
||||||
},
|
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> delete(String key) async {
|
|
||||||
await DatabaseStorage.database.delete(tableLicense, where: 'key = ?', whereArgs: [key]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> clearAll() async {
|
|
||||||
await DatabaseStorage.database.delete(tableLicense);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<void> initLicenseService() async {
|
static Future<void> initLicenseService() async {
|
||||||
// for (var element in LicenseStorageKey.values.map((e) => e.value)) {
|
// for (var element in LicenseStorageKey.values.map((e) => e.value)) {
|
||||||
|
|
|
@ -48,8 +48,8 @@ class LocalizationService {
|
||||||
await StorageHelper().s(SecureStorageKey.haveLocal.value, 'true');
|
await StorageHelper().s(SecureStorageKey.haveLocal.value, 'true');
|
||||||
await StorageHelper().s(SecureStorageKey.isLogged.value, 'true');
|
await StorageHelper().s(SecureStorageKey.isLogged.value, 'true');
|
||||||
await WidgetsBinding.instance.endOfFrame;
|
await WidgetsBinding.instance.endOfFrame;
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, '');
|
||||||
StorageHelper().context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -195,8 +195,8 @@ class LocalizationService {
|
||||||
|
|
||||||
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
||||||
if (value.jsonBody['error'] == false) {
|
if (value.jsonBody['error'] == false) {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientName.value, '');
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
context.pop();
|
context.pop();
|
||||||
context.go(
|
context.go(
|
||||||
'/homePage',
|
'/homePage',
|
||||||
|
@ -230,8 +230,8 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _handleError(BuildContext context, String errorMsg) async {
|
static void _handleError(BuildContext context, String errorMsg) async {
|
||||||
final String devUUID = await StorageHelper().g(SQLiteStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
final String userUUID = await StorageHelper().g(SQLiteStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
||||||
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
||||||
log('() => isLinked: $errorMsg');
|
log('() => isLinked: $errorMsg');
|
||||||
|
@ -259,14 +259,14 @@ class LocalizationService {
|
||||||
static Future<bool> _handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
static Future<bool> _handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
||||||
log('() => isUnavailable');
|
log('() => isUnavailable');
|
||||||
try {
|
try {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID']);
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, locals[0]['CLI_NOME']);
|
await StorageHelper().s(KeychainStorageKey.clientName.value, locals[0]['CLI_NOME']);
|
||||||
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) {
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, '');
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientName.value, '');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (response.jsonBody['error'] == false) return await processData(context).then((value) => value);
|
if (response.jsonBody['error'] == false) return await processData(context).then((value) => value);
|
||||||
|
@ -280,10 +280,10 @@ class LocalizationService {
|
||||||
|
|
||||||
static Future<bool> _handleEnabled(BuildContext context, dynamic local) async {
|
static Future<bool> _handleEnabled(BuildContext context, dynamic local) async {
|
||||||
log('() => isEnabled');
|
log('() => isEnabled');
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().s(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||||
await StorageHelper().s(SQLiteStorageKey.userName.value, local['USU_NOME']);
|
await StorageHelper().s(KeychainStorageKey.userName.value, local['USU_NOME']);
|
||||||
return await processData(context);
|
return await processData(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,16 +296,17 @@ class LocalizationService {
|
||||||
|
|
||||||
static Future<void> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
static Future<void> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||||
await StorageHelper()
|
await StorageHelper()
|
||||||
.s(SQLiteStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false');
|
.s(KeychainStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false');
|
||||||
await StorageHelper().s(SQLiteStorageKey.provisional.value,
|
await StorageHelper().s(KeychainStorageKey.provisional.value,
|
||||||
jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false');
|
jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false');
|
||||||
await StorageHelper().s(SQLiteStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false');
|
await StorageHelper()
|
||||||
|
.s(KeychainStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false');
|
||||||
await StorageHelper().s(
|
await StorageHelper().s(
|
||||||
SQLiteStorageKey.petAmount.value,
|
KeychainStorageKey.petAmount.value,
|
||||||
jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty
|
jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty
|
||||||
? '0'
|
? '0'
|
||||||
: jsonBody['petAmountRegister'].toString());
|
: jsonBody['petAmountRegister'].toString());
|
||||||
await StorageHelper().s(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME']);
|
await StorageHelper().s(KeychainStorageKey.userName.value, jsonBody['visitado']['VDO_NOME']);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _isActive(List<dynamic> locals) {
|
static bool _isActive(List<dynamic> locals) {
|
||||||
|
@ -313,7 +314,7 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isInactived(List<dynamic> locals) async {
|
static Future<bool> _isInactived(List<dynamic> locals) async {
|
||||||
String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,21 +323,21 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isUnselected() async {
|
static Future<bool> _isUnselected() async {
|
||||||
String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
String ownerUUID = (await StorageHelper().g(SQLiteStorageKey.ownerUUID.value)) ?? '';
|
String ownerUUID = (await StorageHelper().g(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isSelected(bool isInactived) async {
|
static Future<bool> _isSelected(bool isInactived) async {
|
||||||
String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isAvailable() async {
|
static Future<bool> _isAvailable() async {
|
||||||
String cliUUID = (await StorageHelper().g(SQLiteStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(SQLiteStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class ShareUtil {
|
class ShareUtil {
|
||||||
static Future<void> showShare(payload) async {
|
static Future<void> showShare(payload) async {
|
||||||
final cliName = await StorageHelper().g(SQLiteStorageKey.clientName.value);
|
final cliName = await StorageHelper().g(KeychainStorageKey.clientName.value);
|
||||||
final cliUUID = await StorageHelper().g(SQLiteStorageKey.clientUUID.value);
|
final cliUUID = await StorageHelper().g(KeychainStorageKey.clientUUID.value);
|
||||||
|
|
||||||
for (var i = 0; i < payload['convites'].length; i++) {
|
for (var i = 0; i < payload['convites'].length; i++) {
|
||||||
await Share.share('''
|
await Share.share('''
|
||||||
|
|
Loading…
Reference in New Issue