wip
This commit is contained in:
parent
d82617c7e1
commit
43f5839db0
|
@ -4,6 +4,7 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/cache_util.dart';
|
import 'package:hub/shared/utils/cache_util.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
@ -61,8 +62,8 @@ class UnregisterDevice {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
|
@ -92,9 +93,9 @@ class DeletePet {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'excluirPet';
|
const atividade = 'excluirPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -137,9 +138,9 @@ class UpdatePet {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'atualizarPet';
|
const atividade = 'atualizarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -185,9 +186,9 @@ class GetPets {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'consultaPets';
|
const atividade = 'consultaPets';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -221,9 +222,9 @@ class GetPetPhoto {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'consultaFotoPet';
|
const atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -264,9 +265,9 @@ class RegisterPet {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'cadastrarPet';
|
const atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -311,9 +312,9 @@ class BuscaEnconcomendas {
|
||||||
String? adresseeType = '',
|
String? adresseeType = '',
|
||||||
String? status = '',
|
String? status = '',
|
||||||
}) async {
|
}) async {
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getEncomendas';
|
const atividade = 'getEncomendas';
|
||||||
|
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
@ -355,9 +356,9 @@ class CancelaVisita {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'cancelaVisita';
|
const atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -389,8 +390,8 @@ class CancelaVisita {
|
||||||
|
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final devUUID = CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
|
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -421,9 +422,9 @@ class ChangePanic {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'updVisitado';
|
const atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -457,9 +458,9 @@ class ChangePass {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'updVisitado';
|
const atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -494,8 +495,8 @@ class RespondeVinculo {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
|
@ -527,9 +528,9 @@ class ChangeNotifica {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'updVisitado';
|
const atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -561,9 +562,9 @@ class UpdToken {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final token = AppState().token;
|
final token = SecureStorageHelper().token;
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'updToken',
|
callName: 'updToken',
|
||||||
|
@ -590,12 +591,12 @@ class UpdToken {
|
||||||
class LoginCall {
|
class LoginCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
final devUUID = CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
|
|
||||||
final email = AppState().email;
|
final email = SecureStorageHelper().email;
|
||||||
final password = AppState().passwd;
|
final password = SecureStorageHelper().passwd;
|
||||||
final type = AppState().deviceType;
|
final type = SecureStorageHelper().deviceType;
|
||||||
final description = AppState().deviceDescription;
|
final description = SecureStorageHelper().deviceDescription;
|
||||||
final token = FirebaseMessagingService.getToken();
|
final token = FirebaseMessagingService.getToken();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -694,8 +695,8 @@ class GetLocalsCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLocals',
|
callName: 'getLocals',
|
||||||
|
@ -734,9 +735,9 @@ class PostScheduleVisitorCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'putVisitante';
|
const atividade = 'putVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -789,9 +790,9 @@ class PostScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'putVisita';
|
const atividade = 'putVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -843,9 +844,9 @@ class GetScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = await CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getVisitas';
|
const atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1117,9 +1118,9 @@ class GetDadosCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = await CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getDados';
|
const atividade = 'getDados';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1360,9 +1361,9 @@ class GetVisitorByDocCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getVisitante';
|
const atividade = 'getVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1414,9 +1415,9 @@ class GetFotoVisitanteCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getFotoVisitante';
|
const atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1453,9 +1454,9 @@ class PostProvVisitSchedulingCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'putAgendamentoProv';
|
const atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1502,9 +1503,9 @@ class GetVisitsCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getVisitas';
|
const atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1765,9 +1766,9 @@ class DeleteVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliID = await CacheUtil.get('cliUUID');
|
final cliID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'cancelaVisita';
|
const atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1808,10 +1809,10 @@ class GetPessoasLocalCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final ownerUUID = await CacheUtil.get('ownerUUID');
|
final ownerUUID = SQLiteStorageHelper().ownerUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = await CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
|
@ -1874,9 +1875,9 @@ class RespondeSolicitacaoCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = await CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'respondeSolicitacao';
|
const atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1924,9 +1925,9 @@ class GetAccessCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = await CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = await CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getAcessos';
|
const atividade = 'getAcessos';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2173,10 +2174,10 @@ class GetLiberationsCall {
|
||||||
final StreamController<ApiCallResponse> controller = StreamController();
|
final StreamController<ApiCallResponse> controller = StreamController();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final devUUID = CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getLiberacoes';
|
const atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final response = await ApiManager.instance.makeApiCall(
|
final response = await ApiManager.instance.makeApiCall(
|
||||||
|
@ -2365,9 +2366,9 @@ class GetMessagesCall {
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final devUUID = CacheUtil.get('devUUID');
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = CacheUtil.get('userUUID');
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliUUID = CacheUtil.get('cliUUID');
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
const atividade = 'getMensagens';
|
const atividade = 'getMensagens';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// ignore_for_file: constant_identifier_names, depend_on_referenced_packages, prefer_final_fields
|
|
||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
@ -107,11 +105,8 @@ class ApiCallResponse {
|
||||||
final http.Response? response;
|
final http.Response? response;
|
||||||
final http.StreamedResponse? streamedResponse;
|
final http.StreamedResponse? streamedResponse;
|
||||||
final Object? exception;
|
final Object? exception;
|
||||||
// Whether we received a 2xx status (which generally marks success).
|
|
||||||
bool get succeeded => statusCode >= 200 && statusCode < 300;
|
bool get succeeded => statusCode >= 200 && statusCode < 300;
|
||||||
String getHeader(String headerName) => headers[headerName] ?? '';
|
String getHeader(String headerName) => headers[headerName] ?? '';
|
||||||
// Return the raw body from the response, or if this came from a cloud call
|
|
||||||
// and the body is not a string, then the json encoded body.
|
|
||||||
String get bodyText =>
|
String get bodyText =>
|
||||||
response?.body ??
|
response?.body ??
|
||||||
(jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
(jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
||||||
|
@ -126,7 +121,7 @@ class ApiCallResponse {
|
||||||
dynamic jsonBody;
|
dynamic jsonBody;
|
||||||
try {
|
try {
|
||||||
if (bodyType == BodyType.BLOB) {
|
if (bodyType == BodyType.BLOB) {
|
||||||
jsonBody = response.bodyBytes; // Armazenar os bytes diretamente
|
jsonBody = response.bodyBytes;
|
||||||
} else {
|
} else {
|
||||||
final responseBody = decodeUtf8 && returnBody
|
final responseBody = decodeUtf8 && returnBody
|
||||||
? const Utf8Decoder().convert(response.bodyBytes)
|
? const Utf8Decoder().convert(response.bodyBytes)
|
||||||
|
@ -153,19 +148,13 @@ class ApiCallResponse {
|
||||||
class ApiManager {
|
class ApiManager {
|
||||||
ApiManager._();
|
ApiManager._();
|
||||||
|
|
||||||
// Cache that will ensure identical calls are not repeatedly made.
|
|
||||||
static Map<ApiCallOptions, ApiCallResponse> _apiCache = {};
|
static Map<ApiCallOptions, ApiCallResponse> _apiCache = {};
|
||||||
|
|
||||||
static ApiManager? _instance;
|
static ApiManager? _instance;
|
||||||
static ApiManager get instance => _instance ??= ApiManager._();
|
static ApiManager get instance => _instance ??= ApiManager._();
|
||||||
|
|
||||||
// If your API calls need authentication, populate this field once
|
|
||||||
// the user has authenticated. Alter this as needed.
|
|
||||||
static String? _accessToken;
|
static String? _accessToken;
|
||||||
|
|
||||||
// You may want to call this if, for example, you make a change to the
|
|
||||||
// database and no longer want the cached result of a call that may
|
|
||||||
// have changed.
|
|
||||||
static void clearCache(String callName) => _apiCache.keys
|
static void clearCache(String callName) => _apiCache.keys
|
||||||
.toSet()
|
.toSet()
|
||||||
.forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
.forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
||||||
|
@ -187,7 +176,7 @@ class ApiManager {
|
||||||
bool decodeUtf8,
|
bool decodeUtf8,
|
||||||
bool isStreamingApi, {
|
bool isStreamingApi, {
|
||||||
http.Client? client,
|
http.Client? client,
|
||||||
BodyType? bodyType, // Adicionado para verificar o tipo de corpo
|
BodyType? bodyType,
|
||||||
}) async {
|
}) async {
|
||||||
if (params.isNotEmpty) {
|
if (params.isNotEmpty) {
|
||||||
final specifier =
|
final specifier =
|
||||||
|
@ -213,7 +202,7 @@ class ApiManager {
|
||||||
final response =
|
final response =
|
||||||
await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
||||||
return ApiCallResponse.fromHttpResponse(
|
return ApiCallResponse.fromHttpResponse(
|
||||||
response, returnBody, decodeUtf8, bodyType); // Passar bodyType
|
response, returnBody, decodeUtf8, bodyType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<ApiCallResponse> requestWithBody(
|
static Future<ApiCallResponse> requestWithBody(
|
||||||
|
@ -368,7 +357,6 @@ class ApiManager {
|
||||||
case null:
|
case null:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Set "Content-Type" header if it was previously unset.
|
|
||||||
if (contentType != null &&
|
if (contentType != null &&
|
||||||
!headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
!headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
||||||
headers['Content-Type'] = contentType;
|
headers['Content-Type'] = contentType;
|
||||||
|
@ -428,7 +416,6 @@ class ApiManager {
|
||||||
cache: cache,
|
cache: cache,
|
||||||
isStreamingApi: isStreamingApi,
|
isStreamingApi: isStreamingApi,
|
||||||
);
|
);
|
||||||
// Modify for your specific needs if this differs from your API.
|
|
||||||
if (_accessToken != null) {
|
if (_accessToken != null) {
|
||||||
headers[HttpHeaders.authorizationHeader] = 'Bearer $_accessToken';
|
headers[HttpHeaders.authorizationHeader] = 'Bearer $_accessToken';
|
||||||
}
|
}
|
||||||
|
@ -436,8 +423,6 @@ class ApiManager {
|
||||||
apiUrl = 'https://$apiUrl';
|
apiUrl = 'https://$apiUrl';
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we've already made this exact call before and caching is on,
|
|
||||||
// return the cached result.
|
|
||||||
if (cache && _apiCache.containsKey(callOptions)) {
|
if (cache && _apiCache.containsKey(callOptions)) {
|
||||||
return _apiCache[callOptions]!;
|
return _apiCache[callOptions]!;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +489,6 @@ class ApiManager {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If caching is on, cache the result (if present).
|
|
||||||
if (cache) {
|
if (cache) {
|
||||||
_apiCache[callOptions] = result;
|
_apiCache[callOptions] = result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ class FirebaseMessagingService {
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
|
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
AppState().token = deviceToken;
|
SecureStorageHelper().token = deviceToken;
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
|
|
||||||
response = await PhpGroup.updToken.call();
|
response = await PhpGroup.updToken.call();
|
||||||
|
|
|
@ -13,6 +13,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
@ -20,10 +21,8 @@ import 'package:sqflite/sqflite.dart';
|
||||||
Future<void> onMessageReceived(
|
Future<void> onMessageReceived(
|
||||||
Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
final cliUUID = await db
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
answersRequest(
|
answersRequest(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
required String? ref,
|
required String? ref,
|
||||||
|
@ -50,7 +49,7 @@ Future<void> onMessageReceived(
|
||||||
switch (handleClick) {
|
switch (handleClick) {
|
||||||
case 'visit_request':
|
case 'visit_request':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: AppState().context!,
|
context: SecureStorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -173,7 +172,7 @@ Future<void> onMessageReceived(
|
||||||
break;
|
break;
|
||||||
case 'access':
|
case 'access':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: AppState().context!,
|
context: SecureStorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -232,7 +231,7 @@ Future<void> onMessageReceived(
|
||||||
break;
|
break;
|
||||||
case 'mensagem':
|
case 'mensagem':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: AppState().context!,
|
context: SecureStorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -255,8 +254,8 @@ Future<void> onMessageReceived(
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
AppState().haveLocal = true;
|
SecureStorageHelper().haveLocal = true;
|
||||||
AppState().context!.go('/homePage');
|
SecureStorageHelper().context!.go('/homePage');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -292,14 +291,12 @@ class NotificationService {
|
||||||
await AwesomeNotifications()
|
await AwesomeNotifications()
|
||||||
.isNotificationAllowed()
|
.isNotificationAllowed()
|
||||||
.then((isAllowed) async {
|
.then((isAllowed) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final bool requestOSnotification =
|
||||||
final bool requestOSnotification = await db
|
SQLiteStorageHelper().requestOSnotification;
|
||||||
.get(key: 'requestOSnotification', field: 'value')
|
|
||||||
.then((value) => value.toString() == 'true');
|
|
||||||
|
|
||||||
if (!requestOSnotification) {
|
if (!requestOSnotification) {
|
||||||
if (!isAllowed) {
|
if (!isAllowed) {
|
||||||
await db.update('requestOSnotification', 'true', 'util');
|
SQLiteStorageHelper().requestOSnotification = true;
|
||||||
await AwesomeNotifications().requestPermissionToSendNotifications();
|
await AwesomeNotifications().requestPermissionToSendNotifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
final cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
|
|
||||||
if (cliUUID.isEmpty) {
|
if (cliUUID.isEmpty) {
|
||||||
return DialogUtil.warningDefault(context);
|
return DialogUtil.warningDefault(context);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:hub/components/molecular_components/order_filter_modal/order_fil
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
|
|
||||||
class OrderFilterModalWidget extends StatefulWidget {
|
class OrderFilterModalWidget extends StatefulWidget {
|
||||||
final String defaultAdresseeType;
|
final String defaultAdresseeType;
|
||||||
|
@ -25,24 +26,25 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
late Map<String, dynamic> selected;
|
late Map<String, dynamic> selected;
|
||||||
final List<Map<String, String>> adresseeTypeOptions = [
|
final List<Map<String, String>> adresseeTypeOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(AppState().context!)
|
'title': FFLocalizations.of(SecureStorageHelper().context!)
|
||||||
.getVariableText(enText: 'Resident', ptText: 'Morador'),
|
.getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||||
'value': 'MOR'
|
'value': 'MOR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(AppState().context!)
|
'title': FFLocalizations.of(SecureStorageHelper().context!)
|
||||||
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||||
'value': 'PRO'
|
'value': 'PRO'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
final List<Map<String, String>> statusOptions = [
|
final List<Map<String, String>> statusOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(AppState().context!).getVariableText(
|
'title': FFLocalizations.of(SecureStorageHelper().context!)
|
||||||
|
.getVariableText(
|
||||||
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||||
'value': 'notPickedUp'
|
'value': 'notPickedUp'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(AppState().context!)
|
'title': FFLocalizations.of(SecureStorageHelper().context!)
|
||||||
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||||
'value': 'pickedUp'
|
'value': 'pickedUp'
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,10 +65,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
|
|
||||||
Future<ApiCallResponse?> _fetchLocals() async {
|
Future<ApiCallResponse?> _fetchLocals() async {
|
||||||
try {
|
try {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
final devUUID = await db.get(key: 'devUUID', field: 'value');
|
|
||||||
final userUUID = await db.get(key: 'userUUID', field: 'value');
|
|
||||||
|
|
||||||
setState(() => _loading = true);
|
setState(() => _loading = true);
|
||||||
var response = await PhpGroup.getLocalsCall.call();
|
var response = await PhpGroup.getLocalsCall.call();
|
||||||
|
|
||||||
|
@ -84,9 +80,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
// Verifica se há apenas um local e se o status é 'A'
|
// Verifica se há apenas um local e se o status é 'A'
|
||||||
if (locals.length == 1 && locals[0]['CLU_STATUS'] == 'A') {
|
if (locals.length == 1 && locals[0]['CLU_STATUS'] == 'A') {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
db.update('cliUUID', local['CLI_ID'], 'local');
|
SQLiteStorageHelper().cliName = local['CLI_NOME'];
|
||||||
db.update('cliName', local['CLI_NOME'], 'local');
|
SQLiteStorageHelper().cliUUID = local['CLI_ID'];
|
||||||
db.update('ownerUUID', local['CLU_OWNER_ID'], 'local');
|
SQLiteStorageHelper().ownerUUID = local['CLU_OWNER_ID'];
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
|
@ -173,12 +169,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
labelsHashMap: _labelsHashMap(local),
|
labelsHashMap: _labelsHashMap(local),
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
db.update('cliUUID', local['CLI_ID'], 'local');
|
SQLiteStorageHelper().cliUUID = local['CLI_ID'];
|
||||||
db.update('cliName', local['CLI_NOME'], 'local');
|
SQLiteStorageHelper().cliName = local['CLI_NOME'];
|
||||||
db.update('ownerUUID', local['CLU_OWNER_ID'], 'local');
|
SQLiteStorageHelper().ownerUUID = local['CLU_OWNER_ID'];
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
} else if (local['CLU_STATUS'] == 'B') {
|
} else if (local['CLU_STATUS'] == 'B') {
|
||||||
|
@ -247,8 +241,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
double height = MediaQuery.sizeOf(context).height;
|
double height = MediaQuery.sizeOf(context).height;
|
||||||
|
|
||||||
return Align(
|
return Align(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'dart:ffi';
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
@ -11,7 +10,6 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class LocalProfileComponentModel
|
class LocalProfileComponentModel
|
||||||
extends FlutterFlowModel<LocalProfileComponentWidget> {
|
extends FlutterFlowModel<LocalProfileComponentWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
String cliName = '';
|
String cliName = '';
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
VoidCallback? setStateCallback;
|
VoidCallback? setStateCallback;
|
||||||
|
@ -22,12 +20,8 @@ class LocalProfileComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
cliName = await db
|
cliName = SQLiteStorageHelper().cliName;
|
||||||
.get(key: 'cliName', field: 'value')
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
setStateCallback?.call();
|
setStateCallback?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@ import 'local_profile_component_model.dart';
|
||||||
|
|
||||||
export 'local_profile_component_model.dart';
|
export 'local_profile_component_model.dart';
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
LocalProfileComponentWidget({Key? key}) : super(key: key);
|
LocalProfileComponentWidget({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -29,7 +27,6 @@ class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
class _LocalProfileComponentWidgetState
|
class _LocalProfileComponentWidgetState
|
||||||
extends State<LocalProfileComponentWidget> {
|
extends State<LocalProfileComponentWidget> {
|
||||||
late LocalProfileComponentModel _model;
|
late LocalProfileComponentModel _model;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
|
@ -45,9 +42,7 @@ class _LocalProfileComponentWidgetState
|
||||||
_model.setStateCallback = () => safeSetState(() {});
|
_model.setStateCallback = () => safeSetState(() {});
|
||||||
|
|
||||||
() async {
|
() async {
|
||||||
_model.cliUUID = await db
|
_model.cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
|
|
||||||
if (_model.cliUUID.isEmpty) {
|
if (_model.cliUUID.isEmpty) {
|
||||||
await processLocals();
|
await processLocals();
|
||||||
|
@ -78,11 +73,11 @@ class _LocalProfileComponentWidgetState
|
||||||
final petAmountRegister = response.jsonBody['petAmountRegister'] ?? '0';
|
final petAmountRegister = response.jsonBody['petAmountRegister'] ?? '0';
|
||||||
final name = response.jsonBody['visitado']['VDO_NOME'];
|
final name = response.jsonBody['visitado']['VDO_NOME'];
|
||||||
|
|
||||||
await db.update('whatsapp', whatsapp.toString(), 'local');
|
SQLiteStorageHelper().whatsapp = whatsapp;
|
||||||
await db.update('provisional', provisional.toString(), 'local');
|
SQLiteStorageHelper().provisional = provisional;
|
||||||
await db.update('pets', pets.toString(), 'local');
|
SQLiteStorageHelper().pets = pets;
|
||||||
await db.update('petAmountRegister', petAmountRegister, 'local');
|
SQLiteStorageHelper().petAmountRegister = petAmountRegister;
|
||||||
await db.update('name', name, 'local');
|
SQLiteStorageHelper().cliName = name;
|
||||||
|
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
return;
|
return;
|
||||||
|
@ -100,9 +95,7 @@ class _LocalProfileComponentWidgetState
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||||
|
|
||||||
final cliUUID = await db
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
var response = await callback.call();
|
var response = await callback.call();
|
||||||
|
|
||||||
List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||||
|
@ -146,8 +139,6 @@ class _LocalProfileComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
|
|
|
@ -3,7 +3,9 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
import 'package:hub/shared/utils/storage_util.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
||||||
|
@ -70,11 +72,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future deliverySchedule(BuildContext context) async {
|
Future deliverySchedule(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final bool isProvisional = SQLiteStorageHelper().provisional;
|
||||||
|
|
||||||
final bool isProvisional = await db
|
|
||||||
.get(key: 'provisional', field: 'value')
|
|
||||||
.then((value) => value.toString() == 'true') as bool;
|
|
||||||
|
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -93,11 +91,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future provisionalSchedule(BuildContext context) async {
|
Future provisionalSchedule(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final isProvisional = SQLiteStorageHelper().provisional;
|
||||||
|
|
||||||
final isProvisional = await db
|
|
||||||
.get(key: 'provisional', field: 'value')
|
|
||||||
.then((value) => value.toString() == 'true') as bool;
|
|
||||||
if (isProvisional == true) {
|
if (isProvisional == true) {
|
||||||
context.push(
|
context.push(
|
||||||
'/provisionalSchedule',
|
'/provisionalSchedule',
|
||||||
|
@ -115,10 +109,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future fastPassAction(BuildContext context) async {
|
Future fastPassAction(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final isWpp = SQLiteStorageHelper().whatsapp;
|
||||||
final isWpp = await db.get(key: 'whatsapp', field: 'value').then((value) {
|
|
||||||
return value.toString() == 'true';
|
|
||||||
}) as bool;
|
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
'/fastPassPage',
|
'/fastPassPage',
|
||||||
|
@ -202,8 +193,6 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> signOut(BuildContext context) async {
|
Future<void> signOut(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
'Logout',
|
'Logout',
|
||||||
|
@ -212,7 +201,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
ptText: 'Tem certeza',
|
ptText: 'Tem certeza',
|
||||||
), () async {
|
), () async {
|
||||||
PhpGroup.unregisterDevice.call();
|
PhpGroup.unregisterDevice.call();
|
||||||
AppState().deleteAll();
|
StorageManager.purge();
|
||||||
|
|
||||||
context.go(
|
context.go(
|
||||||
'/welcomePage',
|
'/welcomePage',
|
||||||
|
@ -224,7 +213,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
await db.purge();
|
await SQLiteStorageHelper().purge();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,10 +231,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future packageOrder(BuildContext context) async {
|
Future packageOrder(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final isWpp = SQLiteStorageHelper().whatsapp;
|
||||||
final isWpp = await db.get(key: 'whatsapp', field: 'value').then((value) {
|
|
||||||
return value.toString() == 'true';
|
|
||||||
}) as bool;
|
|
||||||
|
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
|
@ -264,10 +250,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future reservation(BuildContext context) async {
|
Future reservation(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final isWpp = SQLiteStorageHelper().whatsapp;
|
||||||
final isWpp = await db.get(key: 'whatsapp', field: 'value').then((value) {
|
|
||||||
return value.toString() == 'true';
|
|
||||||
}) as bool;
|
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
'/reservation',
|
'/reservation',
|
||||||
|
@ -383,10 +366,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future petsAction(BuildContext context) async {
|
Future petsAction(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
bool isPet = SQLiteStorageHelper().pets;
|
||||||
bool isPet = await db.get(key: 'pets', field: 'value').then((value) {
|
|
||||||
return value.toString() == 'true';
|
|
||||||
}) as bool;
|
|
||||||
if (isPet) {
|
if (isPet) {
|
||||||
context.push(
|
context.push(
|
||||||
'/petsPage',
|
'/petsPage',
|
||||||
|
|
|
@ -339,7 +339,6 @@ class MessageWellState {
|
||||||
class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
var _totalPageNumber = 1;
|
var _totalPageNumber = 1;
|
||||||
int get totalPageNumber => _totalPageNumber;
|
int get totalPageNumber => _totalPageNumber;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
set totalPageNumber(int value) {
|
set totalPageNumber(int value) {
|
||||||
_totalPageNumber = value;
|
_totalPageNumber = value;
|
||||||
|
|
|
@ -10,7 +10,6 @@ import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class ScheduleVisitDetailModel
|
class ScheduleVisitDetailModel
|
||||||
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -60,9 +59,9 @@ class ScheduleVisitDetailModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = await db.get(key: 'devUUID', field: 'value');
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
userUUID = await db.get(key: 'userUUID', field: 'value');
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
cliUUID = await db.get(key: 'cliUUID', field: 'value');
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -94,7 +94,6 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
final visitorsData = widget.visitorJsonList!.toList().take(2).toList();
|
final visitorsData = widget.visitorJsonList!.toList().take(2).toList();
|
||||||
final visitorsDataItem = visitorsData[0];
|
final visitorsDataItem = visitorsData[0];
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class UpArrowLinkedLocalsComponentModel
|
class UpArrowLinkedLocalsComponentModel
|
||||||
extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -18,18 +17,10 @@ class UpArrowLinkedLocalsComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
cliName = SQLiteStorageHelper().cliName;
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliName = await db
|
|
||||||
.get(key: 'cliName', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -42,8 +42,6 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -9,7 +9,6 @@ import 'access_notification_modal_template_component_widget.dart'
|
||||||
|
|
||||||
class AccessNotificationModalTemplateComponentModel
|
class AccessNotificationModalTemplateComponentModel
|
||||||
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -33,15 +32,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -67,8 +67,6 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
String labelTypeResident = FFLocalizations.of(context)
|
String labelTypeResident = FFLocalizations.of(context)
|
||||||
.getVariableText(enText: 'Resident', ptText: 'Morador');
|
.getVariableText(enText: 'Resident', ptText: 'Morador');
|
||||||
|
|
||||||
|
|
|
@ -208,8 +208,6 @@ class _CardItemTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -129,7 +130,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'INSERT PASSWORD',
|
enText: 'INSERT PASSWORD',
|
||||||
ptText: AppState().accessPass != ''
|
ptText: SecureStorageHelper().accessPass != ''
|
||||||
? 'ALTERAR SENHA'
|
? 'ALTERAR SENHA'
|
||||||
: 'ADICIONAR SENHA',
|
: 'ADICIONAR SENHA',
|
||||||
),
|
),
|
||||||
|
@ -316,9 +317,12 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: SecureStorageHelper().accessPass != ''
|
||||||
AppState().accessPass != '' ? 'Alterar' : 'Adicionar',
|
? 'Alterar'
|
||||||
enText: AppState().accessPass != '' ? 'Change' : 'Add',
|
: 'Adicionar',
|
||||||
|
enText: SecureStorageHelper().accessPass != ''
|
||||||
|
? 'Change'
|
||||||
|
: 'Add',
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 270.0,
|
width: 270.0,
|
||||||
|
|
|
@ -64,7 +64,6 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
|
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
|
|
|
@ -9,7 +9,6 @@ import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
class LiberationHistoryItemDetailsTemplateComponentModel
|
class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
extends FlutterFlowModel<
|
extends FlutterFlowModel<
|
||||||
LiberationHistoryItemDetailsTemplateComponentWidget> {
|
LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -31,15 +30,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -68,8 +68,6 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
|
@ -59,8 +59,6 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
|
|
|
@ -7,7 +7,6 @@ import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
class ScheduleProvisionalVisitPageModel
|
class ScheduleProvisionalVisitPageModel
|
||||||
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
String devUUID = '';
|
String devUUID = '';
|
||||||
String userUUID = '';
|
String userUUID = '';
|
||||||
|
@ -125,11 +124,11 @@ class ScheduleProvisionalVisitPageModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
cliUUID = await db.get(key: 'cliUUID', field: 'value');
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
devUUID = await db.get(key: 'devUUID', field: 'value');
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
userUUID = await db.get(key: 'userUUID', field: 'value');
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
cliName = await db.get(key: 'cliName', field: 'value');
|
cliName = SQLiteStorageHelper().cliName;
|
||||||
ownerUUID = await db.get(key: 'ownerUUID', field: 'value');
|
ownerUUID = SQLiteStorageHelper().ownerUUID;
|
||||||
setState?.call();
|
setState?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,6 @@ class _ScheduleProvisionalVisitPageWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
|
|
@ -12,7 +12,6 @@ import 'regisiter_vistor_template_component_widget.dart';
|
||||||
class RegisiterVistorTemplateComponentModel
|
class RegisiterVistorTemplateComponentModel
|
||||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||||
Timer? _debounceTimer;
|
Timer? _debounceTimer;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -135,9 +134,9 @@ class RegisiterVistorTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = await db.get(key: 'devUUID', field: 'value');
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
userUUID = await db.get(key: 'userUUID', field: 'value');
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
cliUUID = await db.get(key: 'cliUUID', field: 'value');
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -121,7 +121,6 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/flutter_flow/random_data_util.dart';
|
import 'package:hub/flutter_flow/random_data_util.dart';
|
||||||
import 'package:hub/pages/home_page/home_page_model.dart';
|
import 'package:hub/pages/home_page/home_page_model.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/device_util.dart';
|
import 'package:hub/shared/utils/device_util.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
@ -86,9 +87,8 @@ class SignInTemplateComponentModel
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
final LoginCall callback = PhpGroup.loginCall;
|
final LoginCall callback = PhpGroup.loginCall;
|
||||||
AppState().deviceDescription = randomString(
|
SecureStorageHelper().deviceDescription = randomString(
|
||||||
10,
|
10,
|
||||||
10,
|
10,
|
||||||
true,
|
true,
|
||||||
|
@ -111,8 +111,8 @@ class SignInTemplateComponentModel
|
||||||
devUUID = await DeviceUtil.getDevUUID();
|
devUUID = await DeviceUtil.getDevUUID();
|
||||||
|
|
||||||
if ((email != '') && (passwd != '')) {
|
if ((email != '') && (passwd != '')) {
|
||||||
AppState().email = email;
|
SecureStorageHelper().email = email;
|
||||||
AppState().passwd = passwd;
|
SecureStorageHelper().passwd = passwd;
|
||||||
response = await callback.call();
|
response = await callback.call();
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -122,17 +122,17 @@ class SignInTemplateComponentModel
|
||||||
userDevUUID = response.jsonBody['user']['dev_id'];
|
userDevUUID = response.jsonBody['user']['dev_id'];
|
||||||
userName = response.jsonBody['user']['name'];
|
userName = response.jsonBody['user']['name'];
|
||||||
|
|
||||||
db.update('devUUID', devUUID, 'user');
|
SQLiteStorageHelper().devUUID = devUUID!;
|
||||||
db.update('userUUID', userUUID, 'user');
|
SQLiteStorageHelper().userUUID = userUUID;
|
||||||
db.update('userDevUUID', userDevUUID, 'user');
|
SQLiteStorageHelper().userDevUUID = userDevUUID;
|
||||||
db.update('status', status, 'user');
|
SQLiteStorageHelper().status = status;
|
||||||
db.update('userName', userName, 'user');
|
SQLiteStorageHelper().userName = userName;
|
||||||
|
|
||||||
isLogged = true;
|
isLogged = true;
|
||||||
await checkLocals(context: context, model: model).then((value) {
|
await checkLocals(context: context, model: model).then((value) {
|
||||||
AppState().haveLocal = value;
|
SecureStorageHelper().haveLocal = value;
|
||||||
AppState().isLogged = isLogged;
|
SecureStorageHelper().isLogged = isLogged;
|
||||||
AppState().update(() {});
|
SecureStorageHelper().update(() {});
|
||||||
toggleApp(context);
|
toggleApp(context);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -154,7 +154,7 @@ class SignInTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future toggleApp(BuildContext context) async {
|
Future toggleApp(BuildContext context) async {
|
||||||
final haveLocal = AppState().haveLocal;
|
final haveLocal = SecureStorageHelper().haveLocal;
|
||||||
if (haveLocal == true) {
|
if (haveLocal == true) {
|
||||||
context.go('/homePage');
|
context.go('/homePage');
|
||||||
} else if (haveLocal == false) {
|
} else if (haveLocal == false) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -124,8 +125,6 @@ class _SignUpTemplateComponentWidgetState
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
|
@ -702,7 +701,8 @@ class _SignUpTemplateComponentWidgetState
|
||||||
.emailRegisterFormTextController
|
.emailRegisterFormTextController
|
||||||
.text,
|
.text,
|
||||||
device:
|
device:
|
||||||
AppState().deviceType,
|
SecureStorageHelper()
|
||||||
|
.deviceType,
|
||||||
);
|
);
|
||||||
shouldSetState = true;
|
shouldSetState = true;
|
||||||
if (_model.signUp == true) {
|
if (_model.signUp == true) {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -37,15 +36,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -121,8 +121,6 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
var filteredVisitorJsonList =
|
var filteredVisitorJsonList =
|
||||||
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
||||||
|
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -7,7 +7,6 @@ import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class VisitorSearchModalTemplateComponentModel
|
class VisitorSearchModalTemplateComponentModel
|
||||||
extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -40,15 +39,9 @@ class VisitorSearchModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -59,8 +59,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -10,6 +10,7 @@ import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
||||||
import 'package:hub/pages/provisional_schedule_page/provisional_schedule_widget.dart';
|
import 'package:hub/pages/provisional_schedule_page/provisional_schedule_widget.dart';
|
||||||
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
||||||
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
|
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '/backend/schema/structs/index.dart';
|
import '/backend/schema/structs/index.dart';
|
||||||
|
@ -72,8 +73,8 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: '_initialize',
|
name: '_initialize',
|
||||||
path: '/',
|
path: '/',
|
||||||
builder: (context, _) => AppState().isLogged
|
builder: (context, _) => SecureStorageHelper().isLogged
|
||||||
? AppState().haveLocal == true
|
? SecureStorageHelper().haveLocal == true
|
||||||
? const HomePageWidget()
|
? const HomePageWidget()
|
||||||
: const ReceptionPageWidget()
|
: const ReceptionPageWidget()
|
||||||
: const WelcomePageWidget(),
|
: const WelcomePageWidget(),
|
||||||
|
|
|
@ -26,18 +26,20 @@ final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
Future<void> initializeApp() async {
|
Future<void> initializeApp() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await SQLiteStorageHelper().database;
|
await SQLiteStorageHelper().database;
|
||||||
final sharedPreferencesHelper = SharedPreferencesStorageHelper();
|
SQLiteStorageHelper().deleteDatabaseDB();
|
||||||
|
final SharedPreferencesStorageHelper sharedPreferencesHelper =
|
||||||
|
SharedPreferencesStorageHelper();
|
||||||
final SecureStorageHelper secureStorageHelper = SecureStorageHelper();
|
final SecureStorageHelper secureStorageHelper = SecureStorageHelper();
|
||||||
|
|
||||||
await sharedPreferencesHelper.initialize();
|
await sharedPreferencesHelper.ensureInitialization();
|
||||||
|
await secureStorageHelper.ensureInitilization();
|
||||||
|
|
||||||
if (sharedPreferencesHelper.isFirstRun) {
|
if (sharedPreferencesHelper.isFirstRun) {
|
||||||
// Execute actions for the first run
|
|
||||||
sharedPreferencesHelper.isFirstRun = false;
|
sharedPreferencesHelper.isFirstRun = false;
|
||||||
secureStorageHelper.deleteAll();
|
secureStorageHelper.purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
final status = await AppTrackingTransparency.requestTrackingAuthorization();
|
await AppTrackingTransparency.requestTrackingAuthorization();
|
||||||
|
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
await NotificationService.initialize();
|
await NotificationService.initialize();
|
||||||
|
@ -61,7 +63,7 @@ Future<void> initializeApp() async {
|
||||||
|
|
||||||
Future<void> foregroundHandleMessage(RemoteMessage message) async {
|
Future<void> foregroundHandleMessage(RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
SecureStorageHelper().set('haveLocal', 'true');
|
SecureStorageHelper().haveLocal = true;
|
||||||
SecureStorageHelper().context?.go('/homePage');
|
SecureStorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
if (!Platform.isIOS) {
|
if (!Platform.isIOS) {
|
||||||
|
@ -123,6 +125,8 @@ class _AppState extends State<App> {
|
||||||
_backgroundHandleMessage(message);
|
_backgroundHandleMessage(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// SecureStorageHelper().isLogged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLocale(String language) {
|
void setLocale(String language) {
|
||||||
|
@ -139,11 +143,7 @@ class _AppState extends State<App> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MultiProvider(
|
return MaterialApp.router(
|
||||||
providers: const [],
|
|
||||||
// ChangeNotifierProvider(create: (_) => {AppState()}),
|
|
||||||
|
|
||||||
child: MaterialApp.router(
|
|
||||||
title: 'FRE ACCESS HUB',
|
title: 'FRE ACCESS HUB',
|
||||||
builder: (context, widget) => ResponsiveBreakpoints.builder(
|
builder: (context, widget) => ResponsiveBreakpoints.builder(
|
||||||
child: BouncingScrollWrapper.builder(context, widget!),
|
child: BouncingScrollWrapper.builder(context, widget!),
|
||||||
|
@ -199,7 +199,6 @@ class _AppState extends State<App> {
|
||||||
),
|
),
|
||||||
themeMode: _themeMode,
|
themeMode: _themeMode,
|
||||||
routerConfig: _router,
|
routerConfig: _router,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -34,15 +33,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -31,7 +31,6 @@ class _DeliveryScheduleState extends State<DeliverySchedule> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/webview_util.dart';
|
import 'package:hub/shared/utils/webview_util.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
@ -18,30 +19,19 @@ class FastPassPageWidget extends StatefulWidget {
|
||||||
class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
late InAppWebViewController _controllerIOS;
|
late InAppWebViewController _controllerIOS;
|
||||||
late WebViewController _controllerAll;
|
late WebViewController _controllerAll;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = AppState().email;
|
final email = SecureStorageHelper().email;
|
||||||
final name = await db
|
final name = SQLiteStorageHelper().userName;
|
||||||
.get(key: 'userName', field: 'value')
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final userUUID = await db
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.get(key: 'userUUID', field: 'value')
|
final createdAt = '0000-00-00 00:00:00';
|
||||||
.then((value) => value.toString());
|
|
||||||
final devUUID = await db
|
|
||||||
.get(key: 'devUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
final cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
final createdAt = await db
|
|
||||||
.get(key: 'devUUID', field: 'createdAt')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
||||||
final freUserData = "{\"name\": \"$name\", " +
|
final freUserData = "{\"name\": \"$name\", " +
|
||||||
"\"email\": \"$email\"," +
|
"\"email\": \"$email\"," +
|
||||||
"\"dev_id\": \"$devUUID\"," +
|
"\"dev_id\": \"$devUUID\"," +
|
||||||
"\"created_at\": \"$createdAt\"," +
|
"\"created_at\":\"$createdAt\"," +
|
||||||
"\"updated_at\": \"0000-00-00 00:00:00\"," +
|
"\"updated_at\": \"0000-00-00 00:00:00\"," +
|
||||||
"\"status\": \"A\" }";
|
"\"status\": \"A\" }";
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@ import 'package:hub/components/organism_components/menu_component/menu_component
|
||||||
import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart';
|
import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/pages/home_page/home_page_widget.dart';
|
import 'package:hub/pages/home_page/home_page_widget.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
||||||
bool isGrid = false;
|
bool isGrid = false;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
|
@ -25,19 +25,11 @@ class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
||||||
late MessageWellComponentModel messageWellComponentModel;
|
late MessageWellComponentModel messageWellComponentModel;
|
||||||
|
|
||||||
Future<void> _initVariable() async {
|
Future<void> _initVariable() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.then((value) => value.toString());
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
cliUUID = await db
|
userName = SQLiteStorageHelper().cliName;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
userEmail = SecureStorageHelper().email;
|
||||||
.then((value) => value.toString());
|
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
userName = await db
|
|
||||||
.get(key: 'userName', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
userEmail = AppState().email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/pages/home_page/home_page_model.dart';
|
import 'package:hub/pages/home_page/home_page_model.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/widgets/drawer_widget/drawer_widget.dart';
|
import 'package:hub/shared/widgets/drawer_widget/drawer_widget.dart';
|
||||||
|
|
||||||
|
@ -25,7 +26,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
late HomePageModel _model;
|
late HomePageModel _model;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
late LocalProfileComponentWidget _localProfileComponentWidget;
|
late LocalProfileComponentWidget _localProfileComponentWidget;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
_HomePageWidgetState() {
|
_HomePageWidgetState() {
|
||||||
_localProfileComponentWidget = LocalProfileComponentWidget();
|
_localProfileComponentWidget = LocalProfileComponentWidget();
|
||||||
|
@ -52,7 +52,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
AppState().context = context;
|
SecureStorageHelper().context = context;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
|
|
|
@ -8,7 +8,6 @@ import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -39,15 +38,9 @@ class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliName;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future answersRequest(
|
Future answersRequest(
|
||||||
|
|
|
@ -90,7 +90,6 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -9,7 +9,6 @@ import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
|
||||||
class MessageHistoryPageModel
|
class MessageHistoryPageModel
|
||||||
extends FlutterFlowModel<MessageHistoryPageWidget> {
|
extends FlutterFlowModel<MessageHistoryPageWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -44,15 +43,9 @@ class MessageHistoryPageModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = await db
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.get(key: 'devUUID', field: 'value')
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
.then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
cliUUID = await db
|
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -85,7 +85,6 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -28,7 +28,6 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
final int _pageSize = 10;
|
final int _pageSize = 10;
|
||||||
bool _hasData = false;
|
bool _hasData = false;
|
||||||
bool _loading = false;
|
bool _loading = false;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
|
||||||
late Future<void> _orderFuture;
|
late Future<void> _orderFuture;
|
||||||
|
@ -64,9 +63,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
cliUUID = await db
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -41,8 +41,6 @@ class _PeopleOnThePropertyPageWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -243,19 +243,10 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen>
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
final cliUUID = await db
|
final cliName = SQLiteStorageHelper().cliName;
|
||||||
.get(key: 'cliUUID', field: 'value')
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
.then((value) => value.toString());
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final cliName = await db
|
|
||||||
.get(key: 'cliName', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
final devUUID = await db
|
|
||||||
.get(key: 'devUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
final userUUID = await db
|
|
||||||
.get(key: 'userUUID', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -19,7 +19,6 @@ import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -103,18 +102,10 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
||||||
|
|
||||||
Future<void> initAsync() async {
|
Future<void> initAsync() async {
|
||||||
devUUID = await db.get(key: 'devUUID', field: 'value').then((value) {
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
return value.toString();
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
});
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db.get(key: 'userUUID', field: 'value').then((value) {
|
petAmountRegister = SQLiteStorageHelper().petAmountRegister.toString();
|
||||||
return value.toString();
|
|
||||||
});
|
|
||||||
cliUUID = await db.get(key: 'cliUUID', field: 'value').then((value) {
|
|
||||||
return value.toString();
|
|
||||||
});
|
|
||||||
petAmountRegister = await db
|
|
||||||
.get(key: 'petAmountRegister', field: 'value')
|
|
||||||
.then((value) => value.toString());
|
|
||||||
|
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,14 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
import 'package:hub/shared/utils/storage_util.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
class PreferencesPageModel with ChangeNotifier {
|
class PreferencesPageModel with ChangeNotifier {
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
bool fingerprint = false;
|
bool fingerprint = false;
|
||||||
bool person = false;
|
bool person = false;
|
||||||
bool notify = false;
|
bool notify = false;
|
||||||
|
@ -24,7 +25,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> enablePerson(BuildContext context) async {
|
Future<void> enablePerson(BuildContext context) async {
|
||||||
final String userDevUUID = await db.get(key: 'userDevUUID', field: 'value');
|
final String userDevUUID = SQLiteStorageHelper().userDevUUID;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -69,7 +70,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> toggleAccess(BuildContext context) async {
|
Future<void> toggleAccess(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
AppState().accessPass = key;
|
SecureStorageHelper().accessPass = key;
|
||||||
await PhpGroup.changePass
|
await PhpGroup.changePass
|
||||||
.call(
|
.call(
|
||||||
newSenha: key,
|
newSenha: key,
|
||||||
|
@ -105,10 +106,10 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> togglePanic(BuildContext context) async {
|
Future<void> togglePanic(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
AppState().panicPass = key;
|
SecureStorageHelper().panicPass = key;
|
||||||
await PhpGroup.changePanic
|
await PhpGroup.changePanic
|
||||||
.call(
|
.call(
|
||||||
newSenhaPanico: AppState().panicPass,
|
newSenhaPanico: SecureStorageHelper().panicPass,
|
||||||
)
|
)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
final String content;
|
final String content;
|
||||||
|
@ -146,8 +147,8 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
|
|
||||||
onChange(String? key) async {
|
onChange(String? key) async {
|
||||||
if (!fingerprint) AppState().fingerprintPass = key ?? '';
|
if (!fingerprint) SecureStorageHelper().fingerprintPass = key ?? '';
|
||||||
if (fingerprint) AppState().deleteFingerprintPass();
|
if (fingerprint) SecureStorageHelper().delete('fingerprintPass');
|
||||||
|
|
||||||
fingerprint = await _toggleBoolInDb('fingerprint');
|
fingerprint = await _toggleBoolInDb('fingerprint');
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -177,7 +178,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
ptText: 'Conta deletada com sucesso',
|
ptText: 'Conta deletada com sucesso',
|
||||||
);
|
);
|
||||||
|
|
||||||
AppState().deleteAll();
|
StorageManager.purge();
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
context.go(
|
context.go(
|
||||||
|
@ -223,7 +224,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
ptText: 'Tem certeza que deseja sair?',
|
ptText: 'Tem certeza que deseja sair?',
|
||||||
);
|
);
|
||||||
onConfirm() async {
|
onConfirm() async {
|
||||||
AppState().deleteAll();
|
StorageManager.purge();
|
||||||
|
|
||||||
context.go(
|
context.go(
|
||||||
'/welcomePage',
|
'/welcomePage',
|
||||||
|
@ -259,9 +260,9 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) {
|
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) {
|
||||||
if (value.jsonBody['error'] == false) {
|
if (value.jsonBody['error'] == false) {
|
||||||
db.clear('cliName');
|
SQLiteStorageHelper().cliName = '';
|
||||||
db.clear('cliUUID');
|
SQLiteStorageHelper().cliUUID = '';
|
||||||
db.clear('ownerUUID');
|
SQLiteStorageHelper().ownerUUID = '';
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|
||||||
|
@ -310,14 +311,15 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _getBoolFromDb(String key) async {
|
Future<bool> _getBoolFromDb(String key) async {
|
||||||
final value = await db.get(key: key, field: 'value');
|
final value = SQLiteStorageHelper().get(key);
|
||||||
return value.toString() == 'true';
|
return value.toString() == 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _toggleBoolInDb(String key) async {
|
Future<bool> _toggleBoolInDb(String key) async {
|
||||||
final currentValue = await _getBoolFromDb(key);
|
final currentValue = await _getBoolFromDb(key);
|
||||||
final newValue = !currentValue;
|
final newValue = !currentValue;
|
||||||
await db.update(key, newValue.toString(), 'util');
|
await SQLiteStorageHelper().set(key, newValue.toString());
|
||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
|
import 'package:hub/shared/utils/storage_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class PreferencesPageWidget extends StatefulWidget {
|
class PreferencesPageWidget extends StatefulWidget {
|
||||||
|
@ -17,8 +18,6 @@ class PreferencesPageWidget extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
@ -240,7 +239,7 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
||||||
enText: 'Are you sure you want to logout?',
|
enText: 'Are you sure you want to logout?',
|
||||||
ptText: 'Tem certeza',
|
ptText: 'Tem certeza',
|
||||||
), () async {
|
), () async {
|
||||||
AppState().deleteAll();
|
StorageManager.purge();
|
||||||
// setState(() {});
|
// setState(() {});
|
||||||
|
|
||||||
context.go(
|
context.go(
|
||||||
|
|
|
@ -31,7 +31,6 @@ class _ProvisionalScheduleState extends State<ProvisionalSchedule> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
|
|
@ -14,7 +14,6 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
String? key = null;
|
String? key = null;
|
||||||
|
|
||||||
DateTime? time;
|
DateTime? time;
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final bool isFingerprint;
|
late final bool isFingerprint;
|
||||||
late final String userDevUUID;
|
late final String userDevUUID;
|
||||||
|
|
||||||
|
@ -28,9 +27,8 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initVariable() async {
|
Future<void> initVariable() async {
|
||||||
isFingerprint =
|
isFingerprint = SQLiteStorageHelper().fingerprint;
|
||||||
await db.get('fingerprint').then((value) => value.toString() == 'true');
|
userDevUUID = SQLiteStorageHelper().userDevUUID;
|
||||||
userDevUUID = await db.get('userDevUUID').then((value) => value.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -6,9 +6,7 @@ import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class ReceptionPageModel with ChangeNotifier {
|
class ReceptionPageModel with ChangeNotifier {
|
||||||
Future<void> getIdenfifier(BuildContext context) async {
|
Future<void> getIdenfifier(BuildContext context) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final String userDevUUID = SQLiteStorageHelper().userDevUUID;
|
||||||
final String userDevUUID =
|
|
||||||
await db.get('userDevUUID').then((value) => value.toString());
|
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/webview_util.dart';
|
import 'package:hub/shared/utils/webview_util.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
@ -18,26 +19,23 @@ class ReservationPageWidget extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ReservationPageWidgetState extends State<ReservationPageWidget> {
|
class _ReservationPageWidgetState extends State<ReservationPageWidget> {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late InAppWebViewController _controllerIOS;
|
late InAppWebViewController _controllerIOS;
|
||||||
late WebViewController _controllerAll;
|
late WebViewController _controllerAll;
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = await db.get('email').then((value) => value.toString());
|
final email = SecureStorageHelper().email;
|
||||||
final name = await db.get('userName').then((value) => value.toString());
|
final name = SQLiteStorageHelper().cliName;
|
||||||
final userUUID = await db.get('userUUID').then((value) => value.toString());
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
final devUUID = await db.get('devUUID').then((value) => value.toString());
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final createdAt = await db
|
final createdAt = SQLiteStorageHelper().createdAt;
|
||||||
.getByField(key: 'devUUID', field: 'createdAt')
|
final clientId = SQLiteStorageHelper().cliUUID;
|
||||||
.then((value) => value.toString());
|
|
||||||
final clientId = await db.get('cliUUID').then((value) => value.toString());
|
|
||||||
|
|
||||||
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
|
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
|
||||||
|
|
||||||
final freUserData = "{\"name\": \"$name\", " +
|
final freUserData = "{\"name\": \"$name\", " +
|
||||||
"\"email\": \"$email\"," +
|
"\"email\": \"$email\"," +
|
||||||
"\"dev_id\": \"$devUUID\"," +
|
"\"dev_id\": \"$devUUID\"," +
|
||||||
"\"created_at\": \"$createdAt\"," +
|
"\"created_at\": \"0000-00-00 00:00:00\"," +
|
||||||
"\"updated_at\": \"0000-00-00 00:00:00\"," +
|
"\"updated_at\": \"0000-00-00 00:00:00\"," +
|
||||||
"\"status\": \"A\" }";
|
"\"status\": \"A\" }";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import 'dart:ffi';
|
|
||||||
|
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
|
@ -26,7 +24,6 @@ class ScheduleCompleteVisitPageModel
|
||||||
late VoidCallback safeSetState;
|
late VoidCallback safeSetState;
|
||||||
late Function(Function) updateState;
|
late Function(Function) updateState;
|
||||||
final _visitHistoryManager = FutureRequestManager<ApiCallResponse>();
|
final _visitHistoryManager = FutureRequestManager<ApiCallResponse>();
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
|
@ -184,9 +181,9 @@ class ScheduleCompleteVisitPageModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initVariables() async {
|
Future<void> _initVariables() async {
|
||||||
devUUID = await db.get('devUUID').then((value) => value.toString());
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
cliUUID = await db.get('cliUUID').then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
userUUID = await db.get('userUUID').then((value) => value.toString());
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -20,7 +20,6 @@ class VisitHistoryWidget extends ScheduleComplete {
|
||||||
|
|
||||||
class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
|
class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
|
||||||
with TickerProviderStateMixin, Status {
|
with TickerProviderStateMixin, Status {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -35,9 +34,9 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
|
||||||
List<dynamic> _visitWrap = [];
|
List<dynamic> _visitWrap = [];
|
||||||
|
|
||||||
Future<void> _initVariables() async {
|
Future<void> _initVariables() async {
|
||||||
devUUID = await db.get('devUUID').then((value) => value.toString());
|
devUUID = SQLiteStorageHelper().devUUID;
|
||||||
userUUID = await db.get('userUUID').then((value) => value.toString());
|
userUUID = SQLiteStorageHelper().userUUID;
|
||||||
cliUUID = await db.get('cliUUID').then((value) => value.toString());
|
cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -246,15 +245,11 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
final cliUUID =
|
final cliName = SQLiteStorageHelper().cliName;
|
||||||
await db.get('cliUUID').then((value) => value.toString());
|
final devUUID = SQLiteStorageHelper().devUUID;
|
||||||
final cliName =
|
final userUUID = SQLiteStorageHelper().userUUID;
|
||||||
await db.get('cliName').then((value) => value.toString());
|
|
||||||
final devUUID =
|
|
||||||
await db.get('devUUID').then((value) => value.toString());
|
|
||||||
final userUUID =
|
|
||||||
await db.get('userUUID').then((value) => value.toString());
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/utils/storage_util.dart';
|
||||||
import 'package:synchronized/synchronized.dart';
|
import 'package:synchronized/synchronized.dart';
|
||||||
|
|
||||||
|
@ -12,7 +13,91 @@ class SecureStorageHelper extends ChangeNotifier implements Storage {
|
||||||
|
|
||||||
SecureStorageHelper._internal();
|
SecureStorageHelper._internal();
|
||||||
|
|
||||||
Future<void> initializePersistedState() async {
|
String _deviceDescription = '';
|
||||||
|
String get deviceDescription => _deviceDescription;
|
||||||
|
set deviceDescription(String value) {
|
||||||
|
_setString('deviceDescription', value);
|
||||||
|
_deviceDescription = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildContext? _context;
|
||||||
|
BuildContext? get context => _context;
|
||||||
|
set context(BuildContext? value) {
|
||||||
|
_setString('ff_context', value.toString());
|
||||||
|
_context = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool? _haveLocal;
|
||||||
|
bool? get haveLocal => _haveLocal;
|
||||||
|
set haveLocal(bool? value) {
|
||||||
|
_setBool('ff_have_local', value);
|
||||||
|
_haveLocal = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _fingerprintPass = '';
|
||||||
|
String get fingerprintPass => _fingerprintPass;
|
||||||
|
set fingerprintPass(String value) {
|
||||||
|
_setString('fingerprintPass', value);
|
||||||
|
_fingerprintPass = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _accessPass = '';
|
||||||
|
String get accessPass => _accessPass;
|
||||||
|
set accessPass(String value) {
|
||||||
|
_setString('accessPass', value);
|
||||||
|
_accessPass = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _panicPass = '';
|
||||||
|
String get panicPass => _panicPass;
|
||||||
|
set panicPass(String value) {
|
||||||
|
_setString('panicPass', value);
|
||||||
|
_panicPass = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? _tokenAPNS = '';
|
||||||
|
String? get tokenAPNS => _tokenAPNS;
|
||||||
|
set tokenAPNS(String? value) {
|
||||||
|
_setString('ff_tokenAPNS', value ?? '');
|
||||||
|
_tokenAPNS = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _email = '';
|
||||||
|
String get email => _email;
|
||||||
|
set email(String value) {
|
||||||
|
_setString('ff_email', value);
|
||||||
|
_email = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _passwd = '';
|
||||||
|
String get passwd => _passwd;
|
||||||
|
set passwd(String value) {
|
||||||
|
_setString('ff_passwd', value);
|
||||||
|
_passwd = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _deviceType = '';
|
||||||
|
String get deviceType => _deviceType;
|
||||||
|
set deviceType(String value) {
|
||||||
|
_setString('ff_deviceType', value);
|
||||||
|
_deviceType = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _isLogged = false;
|
||||||
|
bool get isLogged => _isLogged;
|
||||||
|
set isLogged(bool value) {
|
||||||
|
_setBool('ff_isLogged', value);
|
||||||
|
_isLogged = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String _token = '';
|
||||||
|
String get token => _token;
|
||||||
|
set token(String value) {
|
||||||
|
_setString('ff_token', value);
|
||||||
|
_token = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> ensureInitilization() async {
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_email = await _getString('ff_email');
|
_email = await _getString('ff_email');
|
||||||
_passwd = await _getString('ff_passwd');
|
_passwd = await _getString('ff_passwd');
|
||||||
|
@ -56,55 +141,6 @@ class SecureStorageHelper extends ChangeNotifier implements Storage {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
String _deviceDescription = '';
|
|
||||||
String get deviceDescription => _deviceDescription;
|
|
||||||
set deviceDescription(String value) => _setString('deviceDescription', value);
|
|
||||||
|
|
||||||
BuildContext? _context;
|
|
||||||
BuildContext? get context => _context;
|
|
||||||
set context(BuildContext? value) =>
|
|
||||||
_setString('ff_context', value.toString());
|
|
||||||
|
|
||||||
bool? _haveLocal;
|
|
||||||
bool? get haveLocal => _haveLocal;
|
|
||||||
set haveLocal(bool? value) => _setBool('ff_have_local', value);
|
|
||||||
|
|
||||||
String _fingerprintPass = '';
|
|
||||||
String get fingerprintPass => _fingerprintPass;
|
|
||||||
set fingerprintPass(String value) => _setString('fingerprintPass', value);
|
|
||||||
|
|
||||||
String _accessPass = '';
|
|
||||||
String get accessPass => _accessPass;
|
|
||||||
set accessPass(String value) => _setString('accessPass', value);
|
|
||||||
|
|
||||||
String _panicPass = '';
|
|
||||||
String get panicPass => _panicPass;
|
|
||||||
set panicPass(String value) => _setString('panicPass', value);
|
|
||||||
|
|
||||||
String? _tokenAPNS = '';
|
|
||||||
String? get tokenAPNS => _tokenAPNS;
|
|
||||||
set tokenAPNS(String? value) => _setString('ff_tokenAPNS', value ?? '');
|
|
||||||
|
|
||||||
String _email = '';
|
|
||||||
String get email => _email;
|
|
||||||
set email(String value) => _setString('ff_email', value);
|
|
||||||
|
|
||||||
String _passwd = '';
|
|
||||||
String get passwd => _passwd;
|
|
||||||
set passwd(String value) => _setString('ff_passwd', value);
|
|
||||||
|
|
||||||
String _deviceType = '';
|
|
||||||
String get deviceType => _deviceType;
|
|
||||||
set deviceType(String value) => _setString('ff_deviceType', value);
|
|
||||||
|
|
||||||
bool _isLogged = false;
|
|
||||||
bool get isLogged => _isLogged;
|
|
||||||
set isLogged(bool value) => _setBool('ff_isLogged', value);
|
|
||||||
|
|
||||||
String _token = '';
|
|
||||||
String get token => _token;
|
|
||||||
set token(String value) => _setString('ff_token', value);
|
|
||||||
|
|
||||||
Future<void> _setString(String key, String value) async {
|
Future<void> _setString(String key, String value) async {
|
||||||
await _secureStorage.write(key: key, value: value);
|
await _secureStorage.write(key: key, value: value);
|
||||||
}
|
}
|
||||||
|
@ -115,6 +151,7 @@ class SecureStorageHelper extends ChangeNotifier implements Storage {
|
||||||
|
|
||||||
Future<void> purge() async {
|
Future<void> purge() async {
|
||||||
_secureStorage.deleteAll();
|
_secureStorage.deleteAll();
|
||||||
|
await ensureInitilization();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -13,7 +13,7 @@ class SharedPreferencesStorageHelper implements Storage {
|
||||||
|
|
||||||
SharedPreferencesStorageHelper._internal();
|
SharedPreferencesStorageHelper._internal();
|
||||||
|
|
||||||
Future<void> initialize() async {
|
Future<void> ensureInitialization() async {
|
||||||
_prefs = await SharedPreferences.getInstance();
|
_prefs = await SharedPreferences.getInstance();
|
||||||
_isFirstRun = _prefs.getBool('first_run') ?? true;
|
_isFirstRun = _prefs.getBool('first_run') ?? true;
|
||||||
}
|
}
|
||||||
|
@ -61,5 +61,6 @@ class SharedPreferencesStorageHelper implements Storage {
|
||||||
|
|
||||||
Future<void> purge() async {
|
Future<void> purge() async {
|
||||||
await _prefs.clear();
|
await _prefs.clear();
|
||||||
|
await ensureInitialization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
import 'package:hub/shared/utils/cache_util.dart';
|
||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
import 'dart:developer';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:path/path.dart';
|
||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
|
@ -14,63 +20,8 @@ class DatabaseConfig {
|
||||||
static const String columnUpdateAt = 'updateAt';
|
static const String columnUpdateAt = 'updateAt';
|
||||||
static const String columnResolvedAt = 'resolvedAt';
|
static const String columnResolvedAt = 'resolvedAt';
|
||||||
static const String columnCreatedAt = 'createdAt';
|
static const String columnCreatedAt = 'createdAt';
|
||||||
}
|
|
||||||
|
|
||||||
class SQLiteStorageHelper {
|
static const List<Map<String, dynamic>> initialData = [
|
||||||
static final SQLiteStorageHelper _instance = SQLiteStorageHelper._internal();
|
|
||||||
static Database? _database;
|
|
||||||
|
|
||||||
factory SQLiteStorageHelper() => _instance;
|
|
||||||
|
|
||||||
SQLiteStorageHelper._internal();
|
|
||||||
|
|
||||||
Future<Database> get database async {
|
|
||||||
if (_database != null) return _database!;
|
|
||||||
_database = await _initDatabase();
|
|
||||||
return _database!;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<Database> _initDatabase() async {
|
|
||||||
final path = await _getDatabasePath();
|
|
||||||
log('Database path: $path');
|
|
||||||
return await openDatabase(
|
|
||||||
path,
|
|
||||||
version: DatabaseConfig.dbVersion,
|
|
||||||
onCreate: _onCreate,
|
|
||||||
onOpen: _onOpen,
|
|
||||||
onUpgrade: _onUpgrade,
|
|
||||||
onDowngrade: _onDowngrade,
|
|
||||||
onConfigure: _onConfigure,
|
|
||||||
).catchError((error) {
|
|
||||||
throw error;
|
|
||||||
}).whenComplete(() => log('Database initialized'));
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<String> _getDatabasePath() async {
|
|
||||||
final databasesPath = await getDatabasesPath();
|
|
||||||
final path = join(databasesPath, DatabaseConfig.dbName);
|
|
||||||
log('Database path: $path');
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _onCreate(Database db, int version) async {
|
|
||||||
log('Creating tables...');
|
|
||||||
await db.execute('''
|
|
||||||
CREATE TABLE ${DatabaseConfig.tableKeychain} (
|
|
||||||
${DatabaseConfig.columnKey} TEXT UNIQUE,
|
|
||||||
${DatabaseConfig.columnValue} TEXT,
|
|
||||||
${DatabaseConfig.columnType} TEXT,
|
|
||||||
${DatabaseConfig.columnUpdateAt} TEXT,
|
|
||||||
${DatabaseConfig.columnResolvedAt} TEXT,
|
|
||||||
${DatabaseConfig.columnCreatedAt} TEXT
|
|
||||||
);
|
|
||||||
''');
|
|
||||||
await _insertInitialData(db);
|
|
||||||
log('Tables created');
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _insertInitialData(Database db) async {
|
|
||||||
final initialData = [
|
|
||||||
{'key': 'devUUID', 'value': '', 'type': 'user'},
|
{'key': 'devUUID', 'value': '', 'type': 'user'},
|
||||||
{'key': 'userUUID', 'value': '', 'type': 'user'},
|
{'key': 'userUUID', 'value': '', 'type': 'user'},
|
||||||
{'key': 'userDevUUID', 'value': '', 'type': 'user'},
|
{'key': 'userDevUUID', 'value': '', 'type': 'user'},
|
||||||
|
@ -91,10 +42,69 @@ class SQLiteStorageHelper {
|
||||||
{'key': 'requestOSnotification', 'value': 'false', 'type': 'util'},
|
{'key': 'requestOSnotification', 'value': 'false', 'type': 'util'},
|
||||||
{'key': 'petAmountRegister', 'value': '', 'type': 'local'},
|
{'key': 'petAmountRegister', 'value': '', 'type': 'local'},
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
for (var data in initialData) {
|
class SQLiteStorageHelper {
|
||||||
await db.insert(DatabaseConfig.tableKeychain, data);
|
static final SQLiteStorageHelper _instance = SQLiteStorageHelper._internal();
|
||||||
|
static Database? _database;
|
||||||
|
static String? _databasePath;
|
||||||
|
|
||||||
|
factory SQLiteStorageHelper() => _instance;
|
||||||
|
|
||||||
|
SQLiteStorageHelper._internal();
|
||||||
|
|
||||||
|
Future<Database> get database async {
|
||||||
|
if (_database != null) return _database!;
|
||||||
|
_database = await _initDatabase();
|
||||||
|
return _database!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<String> _getDatabasePath() async {
|
||||||
|
if (_databasePath != null) return _databasePath!;
|
||||||
|
final databasesPath = await getDatabasesPath();
|
||||||
|
_databasePath = join(databasesPath, DatabaseConfig.dbName);
|
||||||
|
log('Database path: $_databasePath');
|
||||||
|
return _databasePath!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Database> _initDatabase() async {
|
||||||
|
final path = await _getDatabasePath();
|
||||||
|
return await openDatabase(
|
||||||
|
path,
|
||||||
|
version: DatabaseConfig.dbVersion,
|
||||||
|
onCreate: _onCreate,
|
||||||
|
onOpen: _onOpen,
|
||||||
|
onUpgrade: _onUpgrade,
|
||||||
|
onDowngrade: _onDowngrade,
|
||||||
|
onConfigure: _onConfigure,
|
||||||
|
).catchError((error) {
|
||||||
|
log('Error initializing database: $error');
|
||||||
|
throw error;
|
||||||
|
}).whenComplete(() async => await setupLocalVariables());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onCreate(Database db, int version) async {
|
||||||
|
log('Creating tables...');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE ${DatabaseConfig.tableKeychain} (
|
||||||
|
${DatabaseConfig.columnKey} TEXT UNIQUE,
|
||||||
|
${DatabaseConfig.columnValue} TEXT,
|
||||||
|
${DatabaseConfig.columnType} TEXT,
|
||||||
|
${DatabaseConfig.columnUpdateAt} TEXT,
|
||||||
|
${DatabaseConfig.columnResolvedAt} TEXT,
|
||||||
|
${DatabaseConfig.columnCreatedAt} TEXT
|
||||||
|
);
|
||||||
|
''');
|
||||||
|
await _insertInitialData(db);
|
||||||
|
log('Tables created');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _insertInitialData(Database db) async {
|
||||||
|
final batch = db.batch();
|
||||||
|
for (var data in DatabaseConfig.initialData) {
|
||||||
|
batch.insert(DatabaseConfig.tableKeychain, data);
|
||||||
|
}
|
||||||
|
await batch.commit(noResult: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onOpen(Database db) async {
|
Future<void> _onOpen(Database db) async {
|
||||||
|
@ -123,151 +133,184 @@ class SQLiteStorageHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _devUUID = '';
|
||||||
|
String _userUUID = '';
|
||||||
|
String _userDevUUID = '';
|
||||||
|
String _status = '';
|
||||||
|
String _userName = '';
|
||||||
|
String _cliUUID = '';
|
||||||
|
String _ownerUUID = '';
|
||||||
|
String _cliName = '';
|
||||||
|
String _petAmountRegister = '';
|
||||||
|
bool _whatsapp = false;
|
||||||
|
bool _provisional = false;
|
||||||
|
bool _pets = false;
|
||||||
|
bool _local = false;
|
||||||
|
bool _notify = false;
|
||||||
|
bool _fingerprint = false;
|
||||||
|
bool _access = false;
|
||||||
|
bool _panic = false;
|
||||||
|
bool _person = false;
|
||||||
|
bool _requestOSnotification = false;
|
||||||
|
|
||||||
|
String get createdAt => '0000-00-00 00:00:00';
|
||||||
|
String get devUUID => _devUUID;
|
||||||
|
String get userUUID => _userUUID;
|
||||||
|
String get userDevUUID => _userDevUUID;
|
||||||
|
String get status => _status;
|
||||||
|
String get userName => _userName;
|
||||||
|
String get cliUUID => _cliUUID;
|
||||||
|
String get ownerUUID => _ownerUUID;
|
||||||
|
String get cliName => _cliName;
|
||||||
|
String get petAmountRegister => _petAmountRegister;
|
||||||
|
bool get whatsapp => _whatsapp;
|
||||||
|
bool get provisional => _provisional;
|
||||||
|
bool get pets => _pets;
|
||||||
|
bool get local => _local;
|
||||||
|
bool get notify => _notify;
|
||||||
|
bool get fingerprint => _fingerprint;
|
||||||
|
bool get access => _access;
|
||||||
|
bool get panic => _panic;
|
||||||
|
bool get person => _person;
|
||||||
|
bool get requestOSnotification => _requestOSnotification;
|
||||||
|
|
||||||
|
set devUUID(String value) => set('devUUID', value);
|
||||||
|
set userUUID(String value) => set('userUUID', value);
|
||||||
|
set userDevUUID(String value) => set('userDevUUID', value);
|
||||||
|
set status(String value) => set('status', value);
|
||||||
|
set userName(String value) => set('userName', value);
|
||||||
|
set cliUUID(String value) => set('cliUUID', value);
|
||||||
|
set ownerUUID(String value) => set('ownerUUID', value);
|
||||||
|
set cliName(String value) => set('cliName', value);
|
||||||
|
set petAmountRegister(String value) => set('petAmountRegister', value);
|
||||||
|
set whatsapp(bool value) => set('whatsapp', value);
|
||||||
|
set provisional(bool value) => set('provisional', value);
|
||||||
|
set pets(bool value) => set('pets', value);
|
||||||
|
set local(bool value) => set('local', value);
|
||||||
|
set notify(bool value) => set('notify', value);
|
||||||
|
set fingerprint(bool value) => set('fingerprint', value);
|
||||||
|
set access(bool value) => set('access', value);
|
||||||
|
set panic(bool value) => set('panic', value);
|
||||||
|
set person(bool value) => set('person', value);
|
||||||
|
set requestOSnotification(bool value) => set('requestOSnotification', value);
|
||||||
|
|
||||||
|
Future<void> setupLocalVariables() async {
|
||||||
|
log('Setting up local variables...');
|
||||||
|
await _database?.transaction((txn) async {
|
||||||
|
final keys = [
|
||||||
|
'devUUID',
|
||||||
|
'userUUID',
|
||||||
|
'userDevUUID',
|
||||||
|
'status',
|
||||||
|
'userName',
|
||||||
|
'cliUUID',
|
||||||
|
'ownerUUID',
|
||||||
|
'cliName',
|
||||||
|
'whatsapp',
|
||||||
|
'provisional',
|
||||||
|
'pets',
|
||||||
|
'local',
|
||||||
|
'notify',
|
||||||
|
'fingerprint',
|
||||||
|
'access',
|
||||||
|
'panic',
|
||||||
|
'person',
|
||||||
|
'requestOSnotification'
|
||||||
|
];
|
||||||
|
|
||||||
|
final results = await Future.wait(keys.map((key) => get(key)));
|
||||||
|
|
||||||
|
_devUUID = results[0]?.toString() ?? '';
|
||||||
|
_userUUID = results[1]?.toString() ?? '';
|
||||||
|
_userDevUUID = results[2]?.toString() ?? '';
|
||||||
|
_status = results[3]?.toString() ?? '';
|
||||||
|
_userName = results[4]?.toString() ?? '';
|
||||||
|
_cliUUID = results[5]?.toString() ?? '';
|
||||||
|
_ownerUUID = results[6]?.toString() ?? '';
|
||||||
|
_cliName = results[7]?.toString() ?? '';
|
||||||
|
_whatsapp = results[8] == 'true';
|
||||||
|
_provisional = results[9] == 'true';
|
||||||
|
_pets = results[10] == 'true';
|
||||||
|
_local = results[11] == 'true';
|
||||||
|
_notify = results[12] == 'true';
|
||||||
|
_fingerprint = results[13] == 'true';
|
||||||
|
_access = results[14] == 'true';
|
||||||
|
_panic = results[15] == 'true';
|
||||||
|
_person = results[16] == 'true';
|
||||||
|
_requestOSnotification = results[17] == 'true';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> getBoolean(String key) async {
|
||||||
|
final value = await get(key);
|
||||||
|
return value == 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> get(String key) async {
|
||||||
|
final cachedValue = CacheUtil.get(key);
|
||||||
|
if (cachedValue != null) {
|
||||||
|
return cachedValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
final db = await database;
|
||||||
|
final result = await db.query(
|
||||||
|
DatabaseConfig.tableKeychain,
|
||||||
|
columns: [DatabaseConfig.columnValue],
|
||||||
|
where: '${DatabaseConfig.columnKey} = ?',
|
||||||
|
whereArgs: [key],
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result.isNotEmpty) {
|
||||||
|
final value = result.first[DatabaseConfig.columnValue];
|
||||||
|
CacheUtil.set(key, value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (error) {
|
||||||
|
log('Error getting value for key $key: $error');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> set(String key, dynamic value) async {
|
||||||
|
CacheUtil.set(key, value);
|
||||||
|
final db = await database;
|
||||||
|
final data = {
|
||||||
|
DatabaseConfig.columnKey: key,
|
||||||
|
DatabaseConfig.columnValue: value.toString(),
|
||||||
|
DatabaseConfig.columnUpdateAt: DateTime.now().toIso8601String(),
|
||||||
|
DatabaseConfig.columnCreatedAt: DateTime.now().toIso8601String(),
|
||||||
|
};
|
||||||
|
|
||||||
|
return await db.insert(
|
||||||
|
DatabaseConfig.tableKeychain,
|
||||||
|
data,
|
||||||
|
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> delete(String key) async {
|
||||||
|
final db = await database;
|
||||||
|
return await db.transaction((txn) async {
|
||||||
|
return await txn.delete(
|
||||||
|
DatabaseConfig.tableKeychain,
|
||||||
|
where: '${DatabaseConfig.columnKey} = ?',
|
||||||
|
whereArgs: [key],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> purge() async {
|
||||||
|
await deleteDatabaseDB();
|
||||||
|
await database;
|
||||||
|
log('Database purged');
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> deleteDatabaseDB() async {
|
Future<void> deleteDatabaseDB() async {
|
||||||
final path = await _getDatabasePath();
|
final path = await _getDatabasePath();
|
||||||
await deleteDatabase(path);
|
await deleteDatabase(path);
|
||||||
log('Database deleted');
|
log('Database deleted');
|
||||||
_database = null;
|
_database = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> getByField({String? key, String? field}) async {
|
|
||||||
try {
|
|
||||||
final db = await database;
|
|
||||||
List<Map<String, dynamic>> queryResult;
|
|
||||||
|
|
||||||
if (field != null && key != null) {
|
|
||||||
queryResult = await db.query(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
columns: [field],
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
} else if (field != null) {
|
|
||||||
queryResult = await db.query(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
columns: [field],
|
|
||||||
);
|
|
||||||
} else if (key != null) {
|
|
||||||
field = DatabaseConfig.columnValue;
|
|
||||||
queryResult = await db.query(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
columns: [field],
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
queryResult = await db.query(DatabaseConfig.tableKeychain);
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Query result for key: $key, field: $field -> $queryResult');
|
|
||||||
|
|
||||||
if (queryResult.isNotEmpty) {
|
|
||||||
return queryResult.first[field];
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
log('Error getting: $error');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> get(String? key) async {
|
|
||||||
try {
|
|
||||||
final db = await database;
|
|
||||||
List<Map<String, dynamic>> queryResult;
|
|
||||||
const String field = DatabaseConfig.columnValue;
|
|
||||||
|
|
||||||
if (key != null) {
|
|
||||||
queryResult = await db.query(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
columns: [field],
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
queryResult = await db.query(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
columns: [field],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Query result for key: $key, field: $field -> $queryResult');
|
|
||||||
|
|
||||||
if (queryResult.isNotEmpty) {
|
|
||||||
return queryResult.first[field];
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
log('Error getting: $error');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<int> insert(String key, dynamic value, String? type) async {
|
|
||||||
final db = await database;
|
|
||||||
|
|
||||||
final Map<String, dynamic> data = {
|
|
||||||
DatabaseConfig.columnKey: key,
|
|
||||||
DatabaseConfig.columnValue: value.toString(),
|
|
||||||
DatabaseConfig.columnType: type,
|
|
||||||
DatabaseConfig.columnUpdateAt: DateTime.now().toIso8601String(),
|
|
||||||
DatabaseConfig.columnResolvedAt: null,
|
|
||||||
DatabaseConfig.columnCreatedAt: DateTime.now().toIso8601String(),
|
|
||||||
};
|
|
||||||
|
|
||||||
log('Inserting: $data');
|
|
||||||
return await db.insert(DatabaseConfig.tableKeychain, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<int> set(String key, dynamic value) async {
|
|
||||||
final db = await database;
|
|
||||||
|
|
||||||
final Map<String, dynamic> data = {
|
|
||||||
DatabaseConfig.columnKey: key,
|
|
||||||
if (value != null) DatabaseConfig.columnValue: value.toString(),
|
|
||||||
// if (type != null) DatabaseConfig.columnType: type,
|
|
||||||
DatabaseConfig.columnUpdateAt: DateTime.now().toIso8601String(),
|
|
||||||
DatabaseConfig.columnResolvedAt: null,
|
|
||||||
DatabaseConfig.columnCreatedAt: DateTime.now().toIso8601String(),
|
|
||||||
};
|
|
||||||
|
|
||||||
log('Updating: $data');
|
|
||||||
return await db.update(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
data,
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<int> clear(String key) async {
|
|
||||||
final db = await database;
|
|
||||||
|
|
||||||
log('Setting value of key: $key to empty string');
|
|
||||||
return await db.update(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
{DatabaseConfig.columnValue: ''},
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<int> delete(String key) async {
|
|
||||||
final db = await database;
|
|
||||||
|
|
||||||
log('Deleting key: $key');
|
|
||||||
return await db.delete(
|
|
||||||
DatabaseConfig.tableKeychain,
|
|
||||||
where: '${DatabaseConfig.columnKey} = ?',
|
|
||||||
whereArgs: [key],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> purge() async {
|
|
||||||
await deleteDatabaseDB();
|
|
||||||
await database;
|
|
||||||
log('Purge');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
class CacheManager {}
|
|
||||||
|
|
||||||
class CacheUtil {
|
class CacheUtil {
|
||||||
static final Map<String, dynamic> _cache = {};
|
static final Map<String, dynamic> _cache = {};
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@ import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class ShareUtil {
|
class ShareUtil {
|
||||||
static Future<void> showShare(payload) async {
|
static Future<void> showShare(payload) async {
|
||||||
final SQLiteStorageHelper db = SQLiteStorageHelper();
|
final cliName = SQLiteStorageHelper().cliName;
|
||||||
final cliName = await db.get('cliName').then((value) => value.toString());
|
final cliUUID = SQLiteStorageHelper().cliUUID;
|
||||||
final cliUUID = await db.get('cliUUID').then((value) => value.toString());
|
|
||||||
|
|
||||||
for (var i = 0; i < payload['convites'].length; i++) {
|
for (var i = 0; i < payload['convites'].length; i++) {
|
||||||
await Share.share('''
|
await Share.share('''
|
||||||
|
|
Loading…
Reference in New Issue