hotfix reformat StorageHelper.instance to StorageHelper()
This commit is contained in:
parent
84814779a8
commit
746e02ee5f
|
@ -15,7 +15,7 @@ void main() {
|
||||||
group('Initialization', () {
|
group('Initialization', () {
|
||||||
group('Navigation', () {
|
group('Navigation', () {
|
||||||
setUpAll(() async => await initializeApp().then(
|
setUpAll(() async => await initializeApp().then(
|
||||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Welcome', (WidgetTester tester) async {
|
testWidgets('Test Welcome', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testWelcome();
|
await _testWelcome();
|
||||||
|
@ -27,7 +27,7 @@ void main() {
|
||||||
group('Authentication', () {
|
group('Authentication', () {
|
||||||
group('Sign in', () {
|
group('Sign in', () {
|
||||||
setUpAll(() async => await initializeApp().then(
|
setUpAll(() async => await initializeApp().then(
|
||||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Sign In', (WidgetTester tester) async {
|
testWidgets('Test Sign In', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testSignIn();
|
await _testSignIn();
|
||||||
|
@ -35,7 +35,7 @@ void main() {
|
||||||
});
|
});
|
||||||
group('Sign up', () {
|
group('Sign up', () {
|
||||||
setUpAll(() async => await initializeApp().then(
|
setUpAll(() async => await initializeApp().then(
|
||||||
(_) async => StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testSignUp();
|
await _testSignUp();
|
||||||
|
|
|
@ -59,9 +59,9 @@ class UnregisterDevice {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
|
@ -89,11 +89,11 @@ 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 =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'excluirPet';
|
const String atividade = 'excluirPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -137,11 +137,11 @@ class UpdatePet {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'atualizarPet';
|
const String atividade = 'atualizarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -186,11 +186,11 @@ class GetPets {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'consultaPets';
|
const String atividade = 'consultaPets';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -223,11 +223,11 @@ class GetPetPhoto {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'consultaFotoPet';
|
const String atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -269,11 +269,11 @@ class RegisterPet {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cadastrarPet';
|
const String atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -317,11 +317,11 @@ class BuscaEnconcomendas {
|
||||||
final String? status,
|
final String? status,
|
||||||
}) async {
|
}) async {
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getEncomendas';
|
const String atividade = 'getEncomendas';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
@ -364,11 +364,11 @@ class CancelaVisita {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -401,9 +401,9 @@ class CancelaVisita {
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -435,11 +435,11 @@ class ChangePanic {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -474,11 +474,11 @@ class ChangePass {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -513,11 +513,11 @@ class RespondeVinculo {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
|
@ -550,11 +550,11 @@ class ChangeNotifica {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -587,13 +587,13 @@ class UpdateIDE {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String newIde =
|
final String newIde =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -626,10 +626,10 @@ class UpdToken {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String token = (await StorageHelper.instance.get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? '';
|
final String token = (await StorageHelper().get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'updToken',
|
callName: 'updToken',
|
||||||
|
@ -657,14 +657,14 @@ class LoginCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String email = (await StorageHelper.instance.get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
final String email = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
||||||
final String password =
|
final String password =
|
||||||
(await StorageHelper.instance.get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
(await StorageHelper().get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
||||||
final String type =
|
final String type =
|
||||||
(await StorageHelper.instance.get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
(await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||||
final String description =
|
final String description =
|
||||||
(await StorageHelper.instance.get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
(await StorageHelper().get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
||||||
final String token = await FirebaseMessagingService.getToken();
|
final String token = await FirebaseMessagingService.getToken();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -740,11 +740,11 @@ class ChangePasswordCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePassword',
|
callName: 'changePassword',
|
||||||
|
@ -804,9 +804,9 @@ class GetLocalsCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLocals',
|
callName: 'getLocals',
|
||||||
|
@ -846,11 +846,11 @@ class PostScheduleVisitorCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putVisitante';
|
const String atividade = 'putVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -904,11 +904,11 @@ class PostScheduleVisitCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putVisita';
|
const String atividade = 'putVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -961,11 +961,11 @@ class GetScheduleVisitCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1238,11 +1238,11 @@ class GetDadosCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getDados';
|
const String atividade = 'getDados';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1474,11 +1474,11 @@ class GetVisitorByDocCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitante';
|
const String atividade = 'getVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1531,11 +1531,11 @@ class GetFotoVisitanteCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getFotoVisitante';
|
const String atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1573,11 +1573,11 @@ class PostProvVisitSchedulingCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putAgendamentoProv';
|
const String atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1625,11 +1625,11 @@ class GetVisitsCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1891,11 +1891,11 @@ class DeleteVisitCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID =
|
final String cliID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1937,13 +1937,13 @@ class GetPessoasLocalCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String ownerUUID =
|
final String ownerUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
|
@ -2007,11 +2007,11 @@ class RespondeSolicitacaoCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'respondeSolicitacao';
|
const String atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2060,11 +2060,11 @@ class GetAccessCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getAcessos';
|
const String atividade = 'getAcessos';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2312,11 +2312,11 @@ class GetLiberationsCall {
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getSolicitacoes';
|
const String atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2507,11 +2507,11 @@ class GetMessagesCall {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID =
|
final String devUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID =
|
final String userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getMensagens';
|
const String atividade = 'getMensagens';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
|
|
@ -43,7 +43,7 @@ class FirebaseMessagingService {
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
|
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.token.value, deviceToken, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.token.value, deviceToken, Storage.SecureStorage);
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
|
|
||||||
response = await PhpGroup.updToken.call();
|
response = await PhpGroup.updToken.call();
|
||||||
|
|
|
@ -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.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
answersRequest(
|
answersRequest(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
|
@ -43,7 +43,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
||||||
switch (handleClick) {
|
switch (handleClick) {
|
||||||
case 'visit_request':
|
case 'visit_request':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageHelper.instance.context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -162,7 +162,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
||||||
break;
|
break;
|
||||||
case 'access':
|
case 'access':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageHelper.instance.context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -219,7 +219,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
||||||
break;
|
break;
|
||||||
case 'mensagem':
|
case 'mensagem':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageHelper.instance.context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -239,8 +239,8 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
StorageHelper.instance.context!.go('/homePage');
|
StorageHelper().context!.go('/homePage');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -271,12 +271,12 @@ class NotificationService {
|
||||||
|
|
||||||
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||||
final bool requestOSnotification =
|
final bool requestOSnotification =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) ==
|
(await StorageHelper().get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) ==
|
||||||
'true';
|
'true';
|
||||||
|
|
||||||
if (requestOSnotification == false) {
|
if (requestOSnotification == false) {
|
||||||
if (isAllowed == false) {
|
if (isAllowed == false) {
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.requestOSNotification.value, 'true', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.requestOSNotification.value, 'true', Storage.SQLiteStorage);
|
||||||
await AwesomeNotifications().requestPermissionToSendNotifications();
|
await AwesomeNotifications().requestPermissionToSendNotifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,24 +28,24 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
final List<Map<String, String>> adresseeTypeOptions = [
|
final List<Map<String, String>> adresseeTypeOptions = [
|
||||||
{
|
{
|
||||||
'title':
|
'title':
|
||||||
FFLocalizations.of(StorageHelper.instance.context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||||
'value': 'MOR'
|
'value': 'MOR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper.instance.context!)
|
'title': FFLocalizations.of(StorageHelper().context!)
|
||||||
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||||
'value': 'PRO'
|
'value': 'PRO'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
final List<Map<String, String>> statusOptions = [
|
final List<Map<String, String>> statusOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper.instance.context!)
|
'title': FFLocalizations.of(StorageHelper().context!)
|
||||||
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||||
'value': 'notPickedUp'
|
'value': 'notPickedUp'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title':
|
'title':
|
||||||
FFLocalizations.of(StorageHelper.instance.context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
FFLocalizations.of(StorageHelper().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||||
'value': 'pickedUp'
|
'value': 'pickedUp'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -96,9 +96,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
|
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
|
@ -130,7 +130,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.instance.set(SQLiteStorageKey.clientUUID.value, cliID, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, cliID, Storage.SQLiteStorage);
|
||||||
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) {
|
||||||
|
@ -140,7 +140,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.instance.set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -188,9 +188,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.instance.set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|
|
@ -18,8 +18,8 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
setStateCallback?.call();
|
setStateCallback?.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
|
|
||||||
Future openDeliverySchedule(BuildContext context) async {
|
Future openDeliverySchedule(BuildContext context) async {
|
||||||
final bool isProvisional =
|
final bool isProvisional =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
'/deliverySchedule',
|
'/deliverySchedule',
|
||||||
|
@ -80,7 +80,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
|
|
||||||
Future openProvisionalSchedule(BuildContext context) async {
|
Future openProvisionalSchedule(BuildContext context) async {
|
||||||
final isProvisional =
|
final isProvisional =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
'/provisionalSchedule',
|
'/provisionalSchedule',
|
||||||
|
@ -98,7 +98,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openFastPassSchedule(BuildContext context) async {
|
Future openFastPassSchedule(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
'/fastPassPage',
|
'/fastPassPage',
|
||||||
|
@ -207,7 +207,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openMyOrders(BuildContext context) async {
|
Future openMyOrders(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
;
|
;
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -226,7 +226,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openReservations(BuildContext context) async {
|
Future openReservations(BuildContext context) async {
|
||||||
final isWpp = await StorageHelper.instance.get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
;
|
;
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -343,7 +343,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openPetsRegister(BuildContext context) async {
|
Future openPetsRegister(BuildContext context) async {
|
||||||
bool isPet = await StorageHelper.instance.get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true';
|
bool isPet = await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == '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.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -16,10 +16,10 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -32,9 +32,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -49,7 +49,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
_accessPass = await StorageHelper.instance.get(SecureStorageKey.accessPass.value, Storage.SecureStorage) ?? '';
|
_accessPass = await StorageHelper().get(SecureStorageKey.accessPass.value, Storage.SecureStorage) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@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.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,12 +138,12 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
ownerUUID = (await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
setState?.call();
|
setState?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,9 +129,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
_deviceType = (await StorageHelper.instance.get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
_deviceType = (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -37,9 +37,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,9 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,15 +81,15 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
return FutureBuilder<Widget>(
|
return FutureBuilder<Widget>(
|
||||||
future: () async {
|
future: () async {
|
||||||
final bool isLogged =
|
final bool isLogged =
|
||||||
await StorageHelper.instance.get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true';
|
await StorageHelper().get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true';
|
||||||
final bool haveLocal =
|
final bool haveLocal =
|
||||||
await StorageHelper.instance.get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true';
|
await StorageHelper().get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true';
|
||||||
final bool haveUserUUID =
|
final bool haveUserUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))
|
||||||
?.isNotEmpty ??
|
?.isNotEmpty ??
|
||||||
false;
|
false;
|
||||||
final bool haveDevUUID =
|
final bool haveDevUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))
|
||||||
?.isNotEmpty ??
|
?.isNotEmpty ??
|
||||||
false;
|
false;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ void main() async {
|
||||||
Future<void> initializeApp() async {
|
Future<void> initializeApp() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await _initializeTracking();
|
await _initializeTracking();
|
||||||
await StorageHelper.instance.init();
|
await StorageHelper().init();
|
||||||
|
|
||||||
await _initializeFirebase();
|
await _initializeFirebase();
|
||||||
await _initializeNotificationService();
|
await _initializeNotificationService();
|
||||||
|
@ -81,8 +81,8 @@ Future<void> _initializeFlutterFlow() async {
|
||||||
|
|
||||||
Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
StorageHelper.instance.context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Platform.isIOS) {
|
if (!Platform.isIOS) {
|
||||||
|
@ -95,8 +95,8 @@ Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
||||||
|
|
||||||
Future<void> _backgroundHandlerMessage(RemoteMessage message) async {
|
Future<void> _backgroundHandlerMessage(RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
StorageHelper.instance.context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,21 +180,21 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
Future<void> initDeepLinks() async {
|
Future<void> initDeepLinks() async {
|
||||||
_appLinks = AppLinks();
|
_appLinks = AppLinks();
|
||||||
_linkSubscription = _appLinks.uriLinkStream.listen((uri) {
|
_linkSubscription = _appLinks.uriLinkStream.listen((uri) {
|
||||||
final bool isRecovered = StorageHelper.instance.isRecovered;
|
final bool isRecovered = StorageHelper().isRecovered;
|
||||||
if (!isRecovered) openAppLink(uri);
|
if (!isRecovered) openAppLink(uri);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void openAppLink(Uri uri) {
|
void openAppLink(Uri uri) {
|
||||||
final bool isRecovered = StorageHelper.instance.isRecovered;
|
final bool isRecovered = StorageHelper().isRecovered;
|
||||||
log('isRecovered: $isRecovered');
|
log('isRecovered: $isRecovered');
|
||||||
if (isRecovered) return;
|
if (isRecovered) return;
|
||||||
StorageHelper.instance.isRecovered = true;
|
StorageHelper().isRecovered = true;
|
||||||
final String email = uri.queryParameters['email'] ?? '';
|
final String email = uri.queryParameters['email'] ?? '';
|
||||||
final String token = uri.queryParameters['token'] ?? '';
|
final String token = uri.queryParameters['token'] ?? '';
|
||||||
final bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
final bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
||||||
if (isNotEmpty) {
|
if (isNotEmpty) {
|
||||||
final BuildContext context = StorageHelper.instance.context!;
|
final BuildContext context = StorageHelper().context!;
|
||||||
final FlutterFlowTheme theme = FlutterFlowTheme.of(context);
|
final FlutterFlowTheme theme = FlutterFlowTheme.of(context);
|
||||||
final Widget screen = ForgotPasswordScreen(email: email, token: token);
|
final Widget screen = ForgotPasswordScreen(email: email, token: token);
|
||||||
builder(context) => screen;
|
builder(context) => screen;
|
||||||
|
@ -208,7 +208,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
// isDismissible: true,
|
// isDismissible: true,
|
||||||
).whenComplete(() => StorageHelper.instance.isRecovered = false);
|
).whenComplete(() => StorageHelper().isRecovered = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
FirebaseMessaging.onMessage.listen(_foregroundHandlerMessage);
|
FirebaseMessaging.onMessage.listen(_foregroundHandlerMessage);
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
log('onMessageOpenedApp');
|
log('onMessageOpenedApp');
|
||||||
} else {
|
} else {
|
||||||
onMessageReceived(message.data, message.notification!.body, message.data['click_action']);
|
onMessageReceived(message.data, message.notification!.body, message.data['click_action']);
|
||||||
|
@ -232,7 +232,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
FirebaseMessaging.instance.getInitialMessage().then((message) async {
|
FirebaseMessaging.instance.getInitialMessage().then((message) async {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
log('getInitialMessage');
|
log('getInitialMessage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -23,15 +23,15 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
late InAppWebViewController _controllerIOS;
|
late InAppWebViewController _controllerIOS;
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = (await StorageHelper.instance.get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
final email = (await StorageHelper().get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
||||||
final name =
|
final name =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final devUUID =
|
final devUUID =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final userUUID =
|
final userUUID =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final cliUUID =
|
final cliUUID =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
const createdAt = '0000-00-00 00:00:00';
|
const createdAt = '0000-00-00 00:00:00';
|
||||||
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
||||||
final freUserData =
|
final freUserData =
|
||||||
|
|
|
@ -110,7 +110,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
context.pop();
|
context.pop();
|
||||||
StorageHelper.instance.isRecovered = false;
|
StorageHelper().isRecovered = false;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|
|
@ -24,11 +24,11 @@ class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
||||||
late MessageWellComponentModel messageWellComponentModel;
|
late MessageWellComponentModel messageWellComponentModel;
|
||||||
|
|
||||||
Future<void> _initVariable() async {
|
Future<void> _initVariable() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userName = (await StorageHelper.instance.get(SQLiteStorageKey.userName.value, Storage.SQLiteStorage)) ?? '';
|
userName = (await StorageHelper().get(SQLiteStorageKey.userName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userEmail = (await StorageHelper.instance.get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
userEmail = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -50,7 +50,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper.instance.context = context;
|
StorageHelper().context = context;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -36,9 +36,9 @@ class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future answersRequest(
|
Future answersRequest(
|
||||||
|
|
|
@ -39,9 +39,9 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -63,7 +63,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -232,13 +232,13 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final userUUID =
|
final userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final cliUUID =
|
final cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final cliName =
|
final cliName =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -102,11 +102,11 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
||||||
|
|
||||||
Future<void> initAsync() async {
|
Future<void> initAsync() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
petAmountRegister =
|
petAmountRegister =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,11 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
isFingerprint =
|
isFingerprint =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||||
isPerson = await StorageHelper.instance.get(SQLiteStorageKey.person.value, Storage.SQLiteStorage) == 'true';
|
isPerson = await StorageHelper().get(SQLiteStorageKey.person.value, Storage.SQLiteStorage) == 'true';
|
||||||
isNotify = await StorageHelper.instance.get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true';
|
isNotify = await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true';
|
||||||
isAccess = await StorageHelper.instance.get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true';
|
isAccess = await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true';
|
||||||
isPanic = await StorageHelper.instance.get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true';
|
isPanic = await StorageHelper().get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true';
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> enablePerson(BuildContext context) async {
|
Future<void> enablePerson(BuildContext context) async {
|
||||||
final String userDevUUID =
|
final String userDevUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -65,7 +65,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.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true', Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true', Storage.SQLiteStorage);
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Notification changed successfully',
|
enText: 'Notification changed successfully',
|
||||||
|
@ -90,7 +90,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async => isNotify =
|
.then((_) async => isNotify =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true')
|
await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
|
@ -139,13 +139,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> toggleAccess(BuildContext context) async {
|
Future<void> toggleAccess(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.accessPass.value, key, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.accessPass.value, key, Storage.SecureStorage);
|
||||||
await PhpGroup.changePass
|
await PhpGroup.changePass
|
||||||
.call(newSenha: key)
|
.call(newSenha: key)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
final String content;
|
final String content;
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true', Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true', Storage.SQLiteStorage);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -169,7 +169,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async => isAccess =
|
.then((_) async => isAccess =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true')
|
await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,13 +178,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> togglePanic(BuildContext context) async {
|
Future<void> togglePanic(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.panicPass.value, key, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.panicPass.value, key, Storage.SecureStorage);
|
||||||
await PhpGroup.changePanic
|
await PhpGroup.changePanic
|
||||||
.call(newSenhaPanico: key)
|
.call(newSenhaPanico: key)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
final String content;
|
final String content;
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true', Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true', Storage.SQLiteStorage);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -208,7 +208,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async =>
|
.then((_) async =>
|
||||||
isPanic = await StorageHelper.instance.get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true')
|
isPanic = await StorageHelper().get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true')
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,13 +223,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
onChange(String? key) async {
|
onChange(String? key) async {
|
||||||
isFingerprint = !isFingerprint;
|
isFingerprint = !isFingerprint;
|
||||||
await StorageHelper.instance.set(SecureStorageKey.fingerprintPass.value, key ?? '', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.fingerprintPass.value, key ?? '', Storage.SecureStorage);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
isFingerprint =
|
isFingerprint =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
||||||
|
|
|
@ -30,8 +30,8 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
|
|
||||||
Future<void> initVariable() async {
|
Future<void> initVariable() async {
|
||||||
isFingerprint =
|
isFingerprint =
|
||||||
await StorageHelper.instance.get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
||||||
userDevUUID = await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage) ?? '';
|
userDevUUID = await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
||||||
await BiometricHelper.checkBiometrics()
|
await BiometricHelper.checkBiometrics()
|
||||||
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
|
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
|
||||||
final key =
|
final key =
|
||||||
await StorageHelper.instance.get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? '';
|
await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? '';
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
||||||
|
|
|
@ -7,7 +7,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 =
|
final String userDevUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
|
|
|
@ -55,7 +55,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper.instance.context = context;
|
StorageHelper().context = context;
|
||||||
return ChangeNotifierProvider(
|
return ChangeNotifierProvider(
|
||||||
create: (context) => ReceptionPageModel(),
|
create: (context) => ReceptionPageModel(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
@ -158,7 +158,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
PhpGroup.unregisterDevice();
|
PhpGroup.unregisterDevice();
|
||||||
|
|
||||||
StorageHelper.instance.clearAll(Storage.SecureStorage);
|
StorageHelper().clearAll(Storage.SecureStorage);
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,15 @@ class _ReservationPageWidgetState extends State<ReservationPageWidget> {
|
||||||
late WebViewController _controllerAll;
|
late WebViewController _controllerAll;
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = (await StorageHelper.instance.get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
final email = (await StorageHelper().get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? '';
|
||||||
final name =
|
final name =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final devUUID =
|
final devUUID =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final userUUID =
|
final userUUID =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
final clientId =
|
final clientId =
|
||||||
(await StorageHelper.instance.get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? '';
|
||||||
const createdAt = '0000-00-00 00:00:00';
|
const createdAt = '0000-00-00 00:00:00';
|
||||||
|
|
||||||
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
|
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
|
||||||
|
|
|
@ -214,9 +214,9 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel<ScheduleComplete>
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initVariables() async {
|
Future<void> _initVariables() async {
|
||||||
devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -34,9 +34,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.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = (await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -233,13 +233,13 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final devUUID = (await StorageHelper.instance.get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final userUUID =
|
final userUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final cliUUID =
|
final cliUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final cliName =
|
final cliName =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
|
|
|
@ -35,7 +35,7 @@ class _SignInPageWidgetState extends State<SignInPageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper.instance.context = context;
|
StorageHelper().context = context;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
|
|
|
@ -36,7 +36,7 @@ class _SignUpPageWidgetState extends State<SignUpPageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper.instance.context = context;
|
StorageHelper().context = context;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
|
|
|
@ -31,13 +31,13 @@ class _WelcomePageWidgetState extends State<WelcomePageWidget> {
|
||||||
// On page load action.
|
// On page load action.
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||||
if (isAndroid == true) {
|
if (isAndroid == true) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.deviceType.value, 'Android', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.deviceType.value, 'Android', Storage.SecureStorage);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else if (isiOS == true) {
|
} else if (isiOS == true) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.deviceType.value, 'iOS', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.deviceType.value, 'iOS', Storage.SecureStorage);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
} else {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.deviceType.value, 'Web', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.deviceType.value, 'Web', Storage.SecureStorage);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -52,7 +52,7 @@ class _WelcomePageWidgetState extends State<WelcomePageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper.instance.context = context;
|
StorageHelper().context = context;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
|
|
|
@ -4,21 +4,21 @@ 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/helpers/sqlite_storage.dart';
|
import 'package:hub/shared/helpers/sqlite_storage.dart';
|
||||||
|
|
||||||
|
|
||||||
class StorageHelper {
|
class StorageHelper {
|
||||||
StorageHelper._();
|
|
||||||
|
|
||||||
|
static final StorageHelper _instance = StorageHelper._internal();
|
||||||
|
factory StorageHelper() => _instance;
|
||||||
|
StorageHelper._internal();
|
||||||
|
|
||||||
|
|
||||||
late BuildContext? _context;
|
late BuildContext? _context;
|
||||||
|
|
||||||
late bool _isRecovered = false;
|
late bool _isRecovered = false;
|
||||||
|
|
||||||
static final StorageHelper instance = StorageHelper._();
|
|
||||||
|
|
||||||
BuildContext? get context => _context;
|
BuildContext? get context => _context;
|
||||||
|
|
||||||
set context(BuildContext? context) => _context = context;
|
set context(BuildContext? context) => _context = context;
|
||||||
|
|
||||||
bool get isRecovered => _isRecovered;
|
bool get isRecovered => _isRecovered;
|
||||||
|
|
||||||
set isRecovered(bool isRecovered) => _isRecovered = isRecovered;
|
set isRecovered(bool isRecovered) => _isRecovered = isRecovered;
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
|
@ -77,4 +77,6 @@ class StorageHelper {
|
||||||
return SQLiteStorage.instance.clearAll();
|
return SQLiteStorage.instance.clearAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,14 +24,14 @@ class AuthenticationService {
|
||||||
List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||||
|
|
||||||
if (locals.isEmpty) {
|
if (locals.isEmpty) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'false', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'false', Storage.SecureStorage);
|
||||||
context.go('/receptionPage');
|
context.go('/receptionPage');
|
||||||
} else {
|
} else {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
context.go('/homePage');
|
context.go('/homePage');
|
||||||
}
|
}
|
||||||
|
|
||||||
await StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.isLogged.value, 'true', Storage.SecureStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future signIn(
|
static Future signIn(
|
||||||
|
@ -44,7 +44,7 @@ class AuthenticationService {
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
final LoginCall callback = PhpGroup.loginCall;
|
final LoginCall callback = PhpGroup.loginCall;
|
||||||
String deviceDescription = randomString(10, 10, true, false, false);
|
String deviceDescription = randomString(10, 10, true, false, false);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SecureStorageKey.deviceDescription.value, deviceDescription, Storage.SecureStorage);
|
.set(SecureStorageKey.deviceDescription.value, deviceDescription, Storage.SecureStorage);
|
||||||
|
|
||||||
final String? devUUID;
|
final String? devUUID;
|
||||||
|
@ -60,9 +60,9 @@ class AuthenticationService {
|
||||||
devUUID = await DeviceUtil.getDevUUID();
|
devUUID = await DeviceUtil.getDevUUID();
|
||||||
|
|
||||||
if ((email != '') && (passwd != '')) {
|
if ((email != '') && (passwd != '')) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.email.value, email, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.email.value, email, Storage.SecureStorage);
|
||||||
await StorageHelper.instance.set(SecureStorageKey.password.value, passwd, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.password.value, passwd, Storage.SecureStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.devUUID.value, devUUID!, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.devUUID.value, devUUID!, Storage.SQLiteStorage);
|
||||||
response = await callback.call();
|
response = await callback.call();
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -71,10 +71,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.instance.set(SQLiteStorageKey.userUUID.value, userUUID, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.userUUID.value, userUUID, Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.userDevUUID.value, userDevUUID, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.userDevUUID.value, userDevUUID, Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.status.value, status, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.status.value, status, Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.userName.value, userName, Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.userName.value, userName, Storage.SQLiteStorage);
|
||||||
|
|
||||||
await login(context);
|
await login(context);
|
||||||
} else {
|
} else {
|
||||||
|
@ -138,8 +138,8 @@ class AuthenticationService {
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
await StorageHelper.instance.clearAll(Storage.SecureStorage);
|
await StorageHelper().clearAll(Storage.SecureStorage);
|
||||||
await StorageHelper.instance.clearAll(Storage.SQLiteStorage);
|
await StorageHelper().clearAll(Storage.SQLiteStorage);
|
||||||
context.go('/welcomePage', extra: extra);
|
context.go('/welcomePage', extra: extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ class AuthenticationService {
|
||||||
enText: 'Account deleted successfully',
|
enText: 'Account deleted successfully',
|
||||||
ptText: 'Conta deletada com sucesso',
|
ptText: 'Conta deletada com sucesso',
|
||||||
);
|
);
|
||||||
await StorageHelper.instance.clearAll(Storage.SecureStorage);
|
await StorageHelper().clearAll(Storage.SecureStorage);
|
||||||
context.pop();
|
context.pop();
|
||||||
context.go('/welcomePage', extra: extra);
|
context.go('/welcomePage', extra: extra);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,12 +33,12 @@ class LocalizationService {
|
||||||
final bool isEnable = !isEmpty && isActive;
|
final bool isEnable = !isEmpty && isActive;
|
||||||
|
|
||||||
if (isEnable) {
|
if (isEnable) {
|
||||||
await StorageHelper.instance.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
await StorageHelper.instance.set(SecureStorageKey.isLogged.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.isLogged.value, 'true', Storage.SecureStorage);
|
||||||
await WidgetsBinding.instance.endOfFrame;
|
await WidgetsBinding.instance.endOfFrame;
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.ownerUUID.value, '', Storage.SQLiteStorage);
|
||||||
StorageHelper.instance.context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log(e.toString(), stackTrace: s);
|
log(e.toString(), stackTrace: s);
|
||||||
|
@ -164,8 +164,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.instance.set(SQLiteStorageKey.clientName.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, '', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
||||||
context.pop();
|
context.pop();
|
||||||
context.go(
|
context.go(
|
||||||
'/homePage',
|
'/homePage',
|
||||||
|
@ -206,15 +206,15 @@ 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.instance.set(SQLiteStorageKey.clientUUID.value, locals[0]['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, locals[0]['CLI_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, locals[0]['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, locals[0]['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
||||||
if (response.jsonBody['error'] == true) {
|
if (response.jsonBody['error'] == true) {
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.ownerUUID.value, '', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, '', Storage.SQLiteStorage);
|
||||||
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);
|
||||||
|
@ -228,10 +228,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.instance.set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.userName.value, local['USU_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(SQLiteStorageKey.userName.value, local['USU_NOME'], Storage.SQLiteStorage);
|
||||||
return await processData(context);
|
return await processData(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isInactived(List<dynamic> locals) async {
|
static Future<bool> _isInactived(List<dynamic> locals) async {
|
||||||
String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,39 +256,39 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isUnselected() async {
|
static Future<bool> _isUnselected() async {
|
||||||
String cliUUID = (await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
String cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
String cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
String ownerUUID =
|
String ownerUUID =
|
||||||
(await StorageHelper.instance.get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
(await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
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.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
String cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
String cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
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.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
String cliName = (await StorageHelper.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
String cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
static Future<void> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.whatsapp.value,
|
await StorageHelper().set(SQLiteStorageKey.whatsapp.value,
|
||||||
jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage);
|
jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.provisional.value,
|
await StorageHelper().set(SQLiteStorageKey.provisional.value,
|
||||||
jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage);
|
jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(SQLiteStorageKey.pets.value,
|
await StorageHelper().set(SQLiteStorageKey.pets.value,
|
||||||
jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage);
|
jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance.set(
|
await StorageHelper().set(
|
||||||
SQLiteStorageKey.petAmount.value,
|
SQLiteStorageKey.petAmount.value,
|
||||||
jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty
|
jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty
|
||||||
? '0'
|
? '0'
|
||||||
: jsonBody['petAmountRegister'].toString(),
|
: jsonBody['petAmountRegister'].toString(),
|
||||||
Storage.SQLiteStorage);
|
Storage.SQLiteStorage);
|
||||||
await StorageHelper.instance
|
await StorageHelper()
|
||||||
.set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage);
|
.set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.instance.get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage);
|
final cliName = await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage);
|
||||||
final cliUUID = await StorageHelper.instance.get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage);
|
final cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage);
|
||||||
|
|
||||||
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