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