Merge pull request #73 from FRE-Informatica/feat/fd-905
FEAT/FD-905 - Modularização da Licença
This commit is contained in:
commit
d5500fbe09
|
@ -32,6 +32,7 @@ analyzer:
|
||||||
errors:
|
errors:
|
||||||
curly_braces_in_flow_control_structures: ignore
|
curly_braces_in_flow_control_structures: ignore
|
||||||
use_build_context_synchronously: ignore
|
use_build_context_synchronously: ignore
|
||||||
|
invalid_annotation_target: ignore
|
||||||
exclude:
|
exclude:
|
||||||
- lib/custom_code/**
|
- lib/custom_code/**
|
||||||
- lib/flutter_flow/custom_functions.dart
|
- lib/flutter_flow/custom_functions.dart
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
description: This file stores settings for Dart & Flutter DevTools.
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
extensions:
|
extensions:
|
||||||
|
- provider: true
|
|
@ -4,8 +4,8 @@ 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/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
|
@ -58,17 +58,55 @@ class PhpGroup {
|
||||||
static GetVehiclesByProperty getVehiclesByProperty = GetVehiclesByProperty();
|
static GetVehiclesByProperty getVehiclesByProperty = GetVehiclesByProperty();
|
||||||
static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty();
|
static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty();
|
||||||
static GetOpenedVisits getOpenedVisits = GetOpenedVisits();
|
static GetOpenedVisits getOpenedVisits = GetOpenedVisits();
|
||||||
|
static GetLicense getLicense = GetLicense();
|
||||||
|
static GetProvSchedules getProvSchedules = GetProvSchedules();
|
||||||
|
}
|
||||||
|
|
||||||
|
class GetProvSchedules {
|
||||||
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
|
// final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
// final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
|
// final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
// final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
// const String atividade = 'getProvSchedules';
|
||||||
|
// const String pageSize = '10';
|
||||||
|
final String baseUrl = 'http://localhost:3000';
|
||||||
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'getProvSchedules',
|
||||||
|
apiUrl: '$baseUrl/getAgendamentoProv.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||||
|
params: {
|
||||||
|
"proId": "8",
|
||||||
|
"status": "AT",
|
||||||
|
"page": page,
|
||||||
|
"pageSize": "10"
|
||||||
|
// 'devUUID': devUUID,
|
||||||
|
// 'userUUID': userUUID,
|
||||||
|
// 'cliID': cliID,
|
||||||
|
// 'atividade': atividade,
|
||||||
|
// 'page': page,
|
||||||
|
// 'pageSize': pageSize,
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetOpenedVisits {
|
class GetOpenedVisits {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getOpenedVisits';
|
const String atividade = 'getOpenedVisits';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getOpenedVisits',
|
callName: 'getOpenedVisits',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -95,12 +133,12 @@ class GetOpenedVisits {
|
||||||
class GetResidentsByProperty {
|
class GetResidentsByProperty {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = await StorageHelper().get(KeychainStorageKey.clientUUID.value) ?? '';
|
||||||
const String atividade = 'getResidentsByProperty';
|
const String atividade = 'getResidentsByProperty';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getResidentsByProperty',
|
callName: 'getResidentsByProperty',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -126,12 +164,12 @@ class GetResidentsByProperty {
|
||||||
class GetVehiclesByProperty {
|
class GetVehiclesByProperty {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVehiclesByProperty';
|
const String atividade = 'getVehiclesByProperty';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getVehiclesByProperty',
|
callName: 'getVehiclesByProperty',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -152,15 +190,49 @@ class GetVehiclesByProperty {
|
||||||
alwaysAllowBody: false,
|
alwaysAllowBody: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GetLicense getLicense = GetLicense();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class GetLicense {
|
||||||
|
Future<ApiCallResponse> call() async {
|
||||||
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'getLicense',
|
||||||
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
'devUUID': devUUID,
|
||||||
|
'userUUID': userUUID,
|
||||||
|
'cliID': cliID,
|
||||||
|
'atividade': 'getLicenca',
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
isStreamingApi: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class UnregisterDevice {
|
class UnregisterDevice {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
apiUrl: '$baseUrl/unregisterDevice.php',
|
apiUrl: '$baseUrl/unregisterDevice.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -185,12 +257,12 @@ class UnregisterDevice {
|
||||||
class DeletePet {
|
class DeletePet {
|
||||||
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'excluirPet';
|
const String atividade = 'excluirPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'deletePet',
|
callName: 'deletePet',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -230,12 +302,12 @@ class UpdatePet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'atualizarPet';
|
const String atividade = 'atualizarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'updatePet',
|
callName: 'updatePet',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -276,12 +348,12 @@ class GetPets {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'consultaPets';
|
const String atividade = 'consultaPets';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPets',
|
callName: 'getPets',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -310,12 +382,12 @@ class GetPetPhoto {
|
||||||
Future<ApiCallResponse> call({final int? petId}) async {
|
Future<ApiCallResponse> call({final int? petId}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'consultaFotoPet';
|
const String atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPetPhoto',
|
callName: 'getPetPhoto',
|
||||||
apiUrl: '$baseUrl/getImage.php',
|
apiUrl: '$baseUrl/getImage.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -353,12 +425,12 @@ class RegisterPet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cadastrarPet';
|
const String atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'registerPet',
|
callName: 'registerPet',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -398,14 +470,14 @@ class BuscaEnconcomendas {
|
||||||
final String? adresseeType,
|
final String? adresseeType,
|
||||||
final String? status,
|
final String? status,
|
||||||
}) async {
|
}) async {
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getEncomendas';
|
const String atividade = 'getEncomendas';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getEncomendas',
|
callName: 'getEncomendas',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -442,12 +514,12 @@ class CancelaVisita {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'cancelaVisita',
|
callName: 'cancelaVisita',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -476,11 +548,11 @@ class CancelaVisita {
|
||||||
|
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'deleteAccount',
|
callName: 'deleteAccount',
|
||||||
apiUrl: '$baseUrl/deleteAccount.php',
|
apiUrl: '$baseUrl/deleteAccount.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -508,12 +580,12 @@ class ChangePanic {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePass',
|
callName: 'changePass',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -544,12 +616,12 @@ class ChangePass {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePass',
|
callName: 'changePass',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -580,11 +652,11 @@ class RespondeVinculo {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
apiUrl: '$baseUrl/responderVinculo.php',
|
apiUrl: '$baseUrl/responderVinculo.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -614,12 +686,12 @@ class ChangeNotifica {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changeNotifica',
|
callName: 'changeNotifica',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -648,13 +720,13 @@ class UpdateIDE {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
final String newIde = (await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String newIde = (await StorageHelper().get(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changeNotifica',
|
callName: 'changeNotifica',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -683,11 +755,11 @@ class UpdToken {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String token = (await StorageHelper().get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? '';
|
final String token = (await StorageHelper().get(SecureStorageKey.token.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'updToken',
|
callName: 'updToken',
|
||||||
apiUrl: '$baseUrl/updtoken.php',
|
apiUrl: '$baseUrl/updtoken.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -712,12 +784,11 @@ class UpdToken {
|
||||||
class LoginCall {
|
class LoginCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String email = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
final String email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||||
final String password = (await StorageHelper().get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
final String password = (await StorageHelper().get(SecureStorageKey.password.value)) ?? '';
|
||||||
final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? '';
|
||||||
final String description =
|
final String description = (await StorageHelper().get(SecureStorageKey.deviceDescription.value)) ?? '';
|
||||||
(await StorageHelper().get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
|
||||||
late final String token;
|
late final String token;
|
||||||
try {
|
try {
|
||||||
token = await FirebaseMessagingService.getToken();
|
token = await FirebaseMessagingService.getToken();
|
||||||
|
@ -728,7 +799,7 @@ class LoginCall {
|
||||||
LogUtil.requestAPIFailed('login.php', email, "Login", e, s);
|
LogUtil.requestAPIFailed('login.php', email, "Login", e, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'login',
|
callName: 'login',
|
||||||
apiUrl: '$baseUrl/login.php',
|
apiUrl: '$baseUrl/login.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -766,7 +837,7 @@ class RegisterCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'register',
|
callName: 'register',
|
||||||
apiUrl: '$baseUrl/registro.php',
|
apiUrl: '$baseUrl/registro.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -800,11 +871,11 @@ class ChangePasswordCall {
|
||||||
required final String psswd,
|
required final String psswd,
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePassword',
|
callName: 'changePassword',
|
||||||
apiUrl: '$baseUrl/alterarSenha.php',
|
apiUrl: '$baseUrl/alterarSenha.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -836,7 +907,7 @@ class ForgotPasswordCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'forgotPassword',
|
callName: 'forgotPassword',
|
||||||
apiUrl: '$baseUrl/iforgot.php',
|
apiUrl: '$baseUrl/iforgot.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -861,10 +932,10 @@ class GetLocalsCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage) ?? '';
|
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
final String userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? '';
|
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLocals',
|
callName: 'getLocals',
|
||||||
apiUrl: '$baseUrl/getLocais.php',
|
apiUrl: '$baseUrl/getLocais.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -901,12 +972,12 @@ class PostScheduleVisitorCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putVisitante';
|
const String atividade = 'putVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'postScheduleVisitor',
|
callName: 'postScheduleVisitor',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -956,12 +1027,12 @@ class PostScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putVisita';
|
const String atividade = 'putVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'postScheduleVisit',
|
callName: 'postScheduleVisit',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1010,12 +1081,12 @@ class GetScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getScheduleVisit',
|
callName: 'getScheduleVisit',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1284,12 +1355,12 @@ class GetDadosCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getDados';
|
const String atividade = 'getDados';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getDados',
|
callName: 'getDados',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1309,7 +1380,7 @@ class GetDadosCall {
|
||||||
cache: false,
|
cache: false,
|
||||||
isStreamingApi: false,
|
isStreamingApi: false,
|
||||||
alwaysAllowBody: false,
|
alwaysAllowBody: false,
|
||||||
);
|
).timeout(const Duration(seconds: 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
||||||
|
@ -1517,12 +1588,12 @@ class GetVisitorByDocCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitante';
|
const String atividade = 'getVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getVisitorByDoc',
|
callName: 'getVisitorByDoc',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1571,12 +1642,12 @@ class GetFotoVisitanteCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getFotoVisitante';
|
const String atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getFotoVisitante',
|
callName: 'getFotoVisitante',
|
||||||
apiUrl: '$baseUrl/getImage.php',
|
apiUrl: '$baseUrl/getImage.php',
|
||||||
callType: ApiCallType.GET,
|
callType: ApiCallType.GET,
|
||||||
|
@ -1610,12 +1681,12 @@ class PostProvVisitSchedulingCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'putAgendamentoProv';
|
const String atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'postProvVisitScheduling',
|
callName: 'postProvVisitScheduling',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1659,12 +1730,12 @@ class GetVisitsCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getVisits',
|
callName: 'getVisits',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1922,12 +1993,12 @@ class DeleteVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'deleteVisit',
|
callName: 'deleteVisit',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -1965,12 +2036,12 @@ class GetPessoasLocalCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
apiUrl: '$baseUrl/getPessoasLocal.php',
|
apiUrl: '$baseUrl/getPessoasLocal.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -2031,12 +2102,12 @@ class RespondeSolicitacaoCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'respondeSolicitacao';
|
const String atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeSolicitacao',
|
callName: 'respondeSolicitacao',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -2081,12 +2152,12 @@ class GetAccessCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getAcessos';
|
const String atividade = 'getAcessos';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getAccess',
|
callName: 'getAccess',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
@ -2330,10 +2401,9 @@ class GetLiberationsCall {
|
||||||
final StreamController<ApiCallResponse> controller = StreamController();
|
final StreamController<ApiCallResponse> controller = StreamController();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID =
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
const String atividade = 'getSolicitacoes';
|
const String atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2523,12 +2593,12 @@ class GetMessagesCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const String atividade = 'getMensagens';
|
const String atividade = 'getMensagens';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getMessages',
|
callName: 'getMessages',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
|
|
|
@ -2,8 +2,8 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
|
||||||
import 'notification_service.dart';
|
import 'notification_service.dart';
|
||||||
|
@ -43,7 +43,7 @@ class FirebaseMessagingService {
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
|
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
await StorageHelper().set(SecureStorageKey.token.value, deviceToken, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.token.value, deviceToken);
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
|
|
||||||
response = await PhpGroup.updToken.call();
|
response = await PhpGroup.updToken.call();
|
||||||
|
|
|
@ -8,14 +8,14 @@ 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/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
|
||||||
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||||
|
|
||||||
final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
|
||||||
answersRequest(
|
answersRequest(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
|
@ -239,7 +239,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
StorageHelper().context!.go('/homePage');
|
StorageHelper().context!.go('/homePage');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -271,11 +271,11 @@ class NotificationService {
|
||||||
|
|
||||||
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||||
final bool requestOSnotification =
|
final bool requestOSnotification =
|
||||||
(await StorageHelper().get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) == 'true';
|
(await StorageHelper().get(KeychainStorageKey.requestOSNotification.value)) == 'true';
|
||||||
|
|
||||||
if (requestOSnotification == false) {
|
if (requestOSnotification == false) {
|
||||||
if (isAllowed == false) {
|
if (isAllowed == false) {
|
||||||
await StorageHelper().set(SQLiteStorageKey.requestOSNotification.value, 'true', Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.requestOSNotification.value, true);
|
||||||
await AwesomeNotifications().requestPermissionToSendNotifications();
|
await AwesomeNotifications().requestPermissionToSendNotifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,18 +5,6 @@ enum AppHeaderComponent {
|
||||||
home,
|
home,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MenuView {
|
|
||||||
list_grid,
|
|
||||||
list,
|
|
||||||
grid,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum MenuItem {
|
|
||||||
button,
|
|
||||||
card,
|
|
||||||
tile,
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FFEnumExtensions<T extends Enum> on T {
|
extension FFEnumExtensions<T extends Enum> on T {
|
||||||
String serialize() => name;
|
String serialize() => name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
enum MenuOption {
|
|
||||||
CompleteSchedule,
|
|
||||||
DeliverySchedule,
|
|
||||||
WorkersOnTheProperty,
|
|
||||||
FastPassSchedule,
|
|
||||||
QRCodeAccessInProperty,
|
|
||||||
AccessOnTheProperty,
|
|
||||||
LiberationsOnTheProperty,
|
|
||||||
MessagesOnTheProperty,
|
|
||||||
ReservationsOnTheLocal,
|
|
||||||
PackagesOnTheProperty,
|
|
||||||
VehiclesOnTheProperty,
|
|
||||||
PetsOnTheProperty,
|
|
||||||
PetsRegister,
|
|
||||||
VisitorsRegister,
|
|
||||||
VisitsOnTheProperty,
|
|
||||||
ResidentsOnTheProperty,
|
|
||||||
SettingsOnTheApp,
|
|
||||||
AboutProperty,
|
|
||||||
LogoutOnTheApp,
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class MenuEntry extends StatefulWidget {
|
|
||||||
const MenuEntry({
|
|
||||||
super.key,
|
|
||||||
required this.action,
|
|
||||||
required this.title,
|
|
||||||
required this.icon,
|
|
||||||
required this.safeSetState,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Function() action;
|
|
||||||
final String title;
|
|
||||||
final IconData icon;
|
|
||||||
final VoidCallback safeSetState;
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@ 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/storage_helper.dart';
|
|
||||||
// ignore: unused_import
|
// ignore: unused_import
|
||||||
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
@ -29,22 +28,22 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
late Map<String, dynamic> selected;
|
late Map<String, dynamic> selected;
|
||||||
final List<Map<String, String>> adresseeTypeOptions = [
|
final List<Map<String, String>> adresseeTypeOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||||
'value': 'MOR'
|
'value': 'MOR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||||
'value': 'PRO'
|
'value': 'PRO'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
final List<Map<String, String>> statusOptions = [
|
final List<Map<String, String>> statusOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper().context!)
|
'title': FFLocalizations.of(navigatorKey.currentContext!)
|
||||||
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||||
'value': 'notPickedUp'
|
'value': 'notPickedUp'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageHelper().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||||
'value': 'pickedUp'
|
'value': 'pickedUp'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,8 +3,8 @@ import 'package:hub/components/organism_components/bottom_arrow_linked_locals_co
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.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/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -105,9 +105,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
|
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
||||||
await StorageHelper().set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
|
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
return widget.response;
|
return widget.response;
|
||||||
|
@ -137,7 +138,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
|
|
||||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
try {
|
try {
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, cliID, Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientUUID.value, cliID);
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -147,7 +148,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -195,9 +196,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||||
await StorageHelper().set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
||||||
|
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import 'local_profile_component_widget.dart' show LocalProfileComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
///
|
|
||||||
|
|
||||||
class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentWidget> {
|
|
||||||
String cliName = '';
|
|
||||||
String cliUUID = '';
|
|
||||||
VoidCallback? setStateCallback;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {
|
|
||||||
getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> getData() async {
|
|
||||||
cliName = await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage) ?? '';
|
|
||||||
cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
|
|
||||||
setStateCallback?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,167 +0,0 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
|
|
||||||
import '/flutter_flow/custom_functions.dart' as functions;
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import '../../../shared/services/localization/localization_service.dart';
|
|
||||||
import 'local_profile_component_model.dart';
|
|
||||||
|
|
||||||
export 'local_profile_component_model.dart';
|
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
|
||||||
const LocalProfileComponentWidget({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<LocalProfileComponentWidget> createState() => _LocalProfileComponentWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidget> {
|
|
||||||
late LocalProfileComponentModel _model;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_model = createModel(context, () => LocalProfileComponentModel());
|
|
||||||
_model.setOnUpdate(onUpdate: () => safeSetState(() {}));
|
|
||||||
_model.setStateCallback = () => safeSetState(() {});
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
||||||
bool initialized = false;
|
|
||||||
bool isDevLinked = _model.cliUUID.isNotEmpty;
|
|
||||||
if (!isDevLinked && !initialized) {
|
|
||||||
initialized = true;
|
|
||||||
await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.maybeDispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
void onUpdate() async {
|
|
||||||
log('() => onUpdate()');
|
|
||||||
await _model.getData();
|
|
||||||
safeSetState(() {});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final textScaler = MediaQuery.textScalerOf(context);
|
|
||||||
final double baseFontSize = 14.0;
|
|
||||||
final double scaledFontSize = baseFontSize * textScaler.scale(1);
|
|
||||||
final double limitedFontSize = scaledFontSize > 20 ? 12 : scaledFontSize;
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Material(
|
|
||||||
color: Colors.transparent,
|
|
||||||
elevation: 0.0,
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 119.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
border: Border.all(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(2.0),
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
|
||||||
await LocalizationService.processLocals(context).whenComplete(() => onUpdate());
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
imageBuilder: (context, imageProvider) => Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: imageProvider,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
imageUrl: valueOrDefault(
|
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${_model.cliUUID}.png',
|
|
||||||
'assets/images/home.png'),
|
|
||||||
width: 80.0,
|
|
||||||
height: 80.0,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
alignment: const Alignment(0.0, 0.0),
|
|
||||||
placeholder: (context, url) => Image.asset('assets/images/home.png'),
|
|
||||||
errorListener: (_) => Image.asset('assets/images/home.png'),
|
|
||||||
errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Tooltip(
|
|
||||||
message: valueOrDefault<String>(
|
|
||||||
functions.convertToUppercase(_model.cliName),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'SEM LOCAL VINCULADO',
|
|
||||||
enText: 'NO LINKED LOCAL',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
valueOrDefault<String>(
|
|
||||||
functions.convertToUppercase(_model.cliName),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'SEM LOCAL VINCULADO',
|
|
||||||
enText: 'NO LINKED LOCAL',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
maxLines: 1,
|
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
fontSize: limitedFontSize,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
.divide(const SizedBox(width: 20.0))
|
|
||||||
.addToStart(const SizedBox(width: 20.0))
|
|
||||||
.addToEnd(const SizedBox(width: 20.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,525 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart';
|
|
||||||
import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_list_view_component/menu_list_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/flutter_flow_util.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
|
||||||
|
|
||||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
|
||||||
import 'menu_component_widget.dart' show MenuComponentWidget;
|
|
||||||
|
|
||||||
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|
||||||
final MenuView style;
|
|
||||||
final MenuItem item;
|
|
||||||
final bool expandable;
|
|
||||||
final List<MenuOption> menuOptions;
|
|
||||||
|
|
||||||
MenuComponentModel({required this.style, required this.item, required this.expandable, required this.menuOptions});
|
|
||||||
|
|
||||||
bool isGrid = false;
|
|
||||||
|
|
||||||
late MenuListViewComponentModel menuListViewComponentModel;
|
|
||||||
late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel;
|
|
||||||
late VoidCallback safeSetState;
|
|
||||||
late List<MenuEntry?> menuEntries;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {
|
|
||||||
menuListViewComponentModel = createModel(context, () => MenuListViewComponentModel());
|
|
||||||
menuStaggeredViewComponentModel = createModel(context, () => MenuStaggeredViewComponentModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
menuListViewComponentModel.dispose();
|
|
||||||
menuStaggeredViewComponentModel.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MenuEntry?> generateMenuEntries(BuildContext context, MenuItem item, List<MenuOption> options) {
|
|
||||||
List<MenuEntry?> entries = [];
|
|
||||||
MenuEntry? addMenuEntry(IconData icon, String enText, String ptText, Function() action) {
|
|
||||||
entries.add(
|
|
||||||
item == MenuItem.button
|
|
||||||
? MenuButtonWidget(
|
|
||||||
icon: icon,
|
|
||||||
action: action,
|
|
||||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
|
||||||
safeSetState: safeSetState)
|
|
||||||
: item == MenuItem.card
|
|
||||||
? MenuCardItem(
|
|
||||||
icon: icon,
|
|
||||||
action: action,
|
|
||||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
|
||||||
safeSetState: safeSetState)
|
|
||||||
: item == MenuItem.tile
|
|
||||||
? MenuCardItem(
|
|
||||||
icon: icon,
|
|
||||||
action: action,
|
|
||||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
|
||||||
safeSetState: safeSetState)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.contains(MenuOption.WorkersOnTheProperty))
|
|
||||||
addMenuEntry(Icons.engineering_outlined, 'Schedule Providers', 'Agendar Prestadores', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/provisionalSchedule');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.DeliverySchedule))
|
|
||||||
addMenuEntry(Icons.sports_motorsports_outlined, 'Schedule Deliveries', 'Agendar Entregas', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/deliverySchedule');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.FastPassSchedule))
|
|
||||||
addMenuEntry(Icons.attach_email_outlined, 'Invite Visitor', 'Convidar Visitante', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/fastPassPage');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.CompleteSchedule))
|
|
||||||
addMenuEntry(Icons.event, 'Complete Schedule', 'Agenda Completa', () async {
|
|
||||||
await open(context, '/scheduleCompleteVisitPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.PackagesOnTheProperty))
|
|
||||||
addMenuEntry(Icons.inventory_2_outlined, 'Orders', 'Encomendas', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/packageOrder');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.ReservationsOnTheLocal))
|
|
||||||
addMenuEntry(Icons.event_available, 'Reservations', 'Reservas', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/reservation');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.VisitorsRegister))
|
|
||||||
addMenuEntry(Icons.person_add_alt_1_outlined, 'Register Visitor', 'Cadastrar Visitante', () async {
|
|
||||||
await open(context, '/registerVisitorPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.QRCodeAccessInProperty))
|
|
||||||
addMenuEntry(Icons.qr_code, 'QRCode Access', 'QRCode de Acesso', () async {
|
|
||||||
await open(context, '/qrCodePage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.PetsOnTheProperty))
|
|
||||||
addMenuEntry(Icons.pets, 'Pets', 'Pets', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/petsOnThePropertyPage');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.PetsRegister))
|
|
||||||
addMenuEntry(Icons.pets, 'Pets Register', 'Cadastrar Pet', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/petsPage');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.AccessOnTheProperty))
|
|
||||||
addMenuEntry(Icons.transfer_within_a_station_outlined, 'Access History', 'Consultar Acessos', () async {
|
|
||||||
await open(context, '/acessHistoryPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.ResidentsOnTheProperty))
|
|
||||||
addMenuEntry(Icons.groups, 'Residents', 'Moradores', () async {
|
|
||||||
await open(context, '/peopleOnThePropertyPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.LiberationsOnTheProperty))
|
|
||||||
addMenuEntry(Icons.how_to_reg_outlined, 'Liberations History', 'Consultar Liberações', () async {
|
|
||||||
await open(context, '/liberationHistory');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.MessagesOnTheProperty))
|
|
||||||
addMenuEntry(Icons.chat_outlined, 'Message History', 'Consultar Mensagens', () async {
|
|
||||||
await open(context, '/messageHistoryPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.VehiclesOnTheProperty))
|
|
||||||
addMenuEntry(Symbols.directions_car, 'Vehicles', 'Veículos', () async {
|
|
||||||
await open(context, '/vehiclesOnThePropertyPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.VisitsOnTheProperty))
|
|
||||||
addMenuEntry(Symbols.perm_contact_calendar, 'Opened Visits', 'Visitas em Aberto', () async {
|
|
||||||
await open(context, '/visitsOnThePropertyPage');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (options.contains(MenuOption.AboutProperty))
|
|
||||||
addMenuEntry(Icons.home, 'About Property', 'Sobre a Propriedade', () async {
|
|
||||||
if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
await open(context, '/aboutProperty');
|
|
||||||
else
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.SettingsOnTheApp))
|
|
||||||
addMenuEntry(Icons.settings, 'System Settings', 'Opções do Sistema', () async {
|
|
||||||
await open(context, '/preferencesSettings');
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
if (options.contains(MenuOption.LogoutOnTheApp))
|
|
||||||
addMenuEntry(Icons.logout, 'Logout', 'Sair', () async {
|
|
||||||
await out(context);
|
|
||||||
safeSetState;
|
|
||||||
});
|
|
||||||
|
|
||||||
return entries;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future open(BuildContext context, String link) async {
|
|
||||||
context.push(
|
|
||||||
link,
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future out(BuildContext context) async {
|
|
||||||
final String title = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Sair',
|
|
||||||
enText: 'Logout',
|
|
||||||
);
|
|
||||||
final String content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Tem certeza que deseja sair?',
|
|
||||||
enText: 'Are you sure you want to logout?',
|
|
||||||
);
|
|
||||||
showAlertDialog(context, title, content, () async => await AuthenticationService.signOut(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openDeliverySchedule(BuildContext context) async {
|
|
||||||
final bool isProvisional =
|
|
||||||
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
if (isProvisional == true) {
|
|
||||||
context.push(
|
|
||||||
'/deliverySchedule',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openProvisionalSchedule(BuildContext context) async {
|
|
||||||
final isProvisional =
|
|
||||||
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
if (isProvisional == true) {
|
|
||||||
context.push(
|
|
||||||
'/provisionalSchedule',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openFastPassSchedule(BuildContext context) async {
|
|
||||||
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
if (isWpp) {
|
|
||||||
context.push(
|
|
||||||
'/fastPassPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future showSchedules(BuildContext context) async {
|
|
||||||
final routesListStr = <String>[
|
|
||||||
'scheduleProvisionalVisitPage',
|
|
||||||
'fastPassPage',
|
|
||||||
'scheduleCompleteVisitPage',
|
|
||||||
];
|
|
||||||
final iconsListIcon = <IconData>[
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
];
|
|
||||||
final nameListStr = <String>[
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nProvisória',
|
|
||||||
enText: 'Provisional\nSchedule',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nRápida',
|
|
||||||
enText: 'Fast\nSchedule',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nCompleta',
|
|
||||||
enText: 'Complete\nSchedule',
|
|
||||||
),
|
|
||||||
];
|
|
||||||
await showAdaptiveDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: OptionSelectionModalWidget(
|
|
||||||
routesListStr: routesListStr,
|
|
||||||
iconsListIcon: iconsListIcon,
|
|
||||||
nameListStr: nameListStr,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openVisitorsRegister(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/registerVisitorPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openPoepleOnTheProperty(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/peopleOnThePropertyPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> Logout(BuildContext context) async {
|
|
||||||
final String title = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Sair',
|
|
||||||
enText: 'Logout',
|
|
||||||
);
|
|
||||||
final String content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Tem certeza que deseja sair?',
|
|
||||||
enText: 'Are you sure you want to logout?',
|
|
||||||
);
|
|
||||||
showAlertDialog(context, title, content, () async => await AuthenticationService.signOut(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openPreferencesSettings(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/preferencesSettings',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openMyOrders(BuildContext context) async {
|
|
||||||
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
;
|
|
||||||
if (isWpp) {
|
|
||||||
context.push(
|
|
||||||
'/packageOrder',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openReservations(BuildContext context) async {
|
|
||||||
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
;
|
|
||||||
if (isWpp) {
|
|
||||||
context.push(
|
|
||||||
'/reservation',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future showHistories(BuildContext context) async {
|
|
||||||
await showAdaptiveDialog(
|
|
||||||
// isScrollControlled: true,
|
|
||||||
// backgroundColor: Colors.transparent,
|
|
||||||
// enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: OptionSelectionModalWidget(
|
|
||||||
routesListStr: const <String>[
|
|
||||||
'liberationHistory',
|
|
||||||
'acessHistoryPage',
|
|
||||||
'scheduleCompleteVisitPage',
|
|
||||||
'messageHistoryPage'
|
|
||||||
],
|
|
||||||
iconsListIcon: const <IconData>[
|
|
||||||
Icons.history_rounded,
|
|
||||||
Icons.history_rounded,
|
|
||||||
Icons.history_rounded,
|
|
||||||
Icons.history_rounded,
|
|
||||||
],
|
|
||||||
nameListStr: <String>[
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Histórico\nde Liberação',
|
|
||||||
enText: 'Liberation\nHistory',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Histórico\nde Acesso',
|
|
||||||
enText: 'Access\nHistory',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Histórico\nde Visita',
|
|
||||||
enText: 'Visit\nHistory',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Histórico\nde Mensagens',
|
|
||||||
enText: 'Message\nHistory',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openLiberationsHistory(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/liberationHistory',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openAccessHistory(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/acessHistoryPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openVisitsHistory(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/scheduleCompleteVisitPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openMessagesHistory(BuildContext context) async {
|
|
||||||
context.push(
|
|
||||||
'/messageHistoryPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future openPetsRegister(BuildContext context) async {
|
|
||||||
bool isPet = await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true';
|
|
||||||
;
|
|
||||||
if (isPet) {
|
|
||||||
context.push(
|
|
||||||
'/petsPage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: false,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,78 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
|
|
||||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
|
||||||
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import 'menu_component_model.dart';
|
|
||||||
|
|
||||||
export 'menu_component_model.dart';
|
|
||||||
|
|
||||||
class MenuComponentWidget extends StatefulWidget {
|
|
||||||
final MenuComponentModel model;
|
|
||||||
const MenuComponentWidget({super.key, required this.model});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MenuComponentWidget> createState() => _MenuComponentWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
widget.model.onUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
widget.model.safeSetState = () => safeSetState(() {});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
widget.model.menuEntries = widget.model.generateMenuEntries(context, widget.model.item, widget.model.menuOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
widget.model.maybeDispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Builder(
|
|
||||||
builder: (context) {
|
|
||||||
if (widget.model.style == MenuView.list_grid)
|
|
||||||
return wrapWithModel(
|
|
||||||
model: widget.model.menuStaggeredViewComponentModel,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
updateOnChange: true,
|
|
||||||
child: MenuStaggeredViewComponentWidget(
|
|
||||||
options: widget.model.menuEntries,
|
|
||||||
expandable: widget.model.expandable,
|
|
||||||
item: widget.model.item,
|
|
||||||
changeMenuStyle: () async {},
|
|
||||||
isGrid: widget.model.isGrid,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (widget.model.style == MenuView.list)
|
|
||||||
return wrapWithModel(
|
|
||||||
model: widget.model.menuListViewComponentModel,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
updateOnChange: true,
|
|
||||||
child: MenuListViewComponentWidget(
|
|
||||||
options: widget.model.menuEntries,
|
|
||||||
expandable: widget.model.expandable,
|
|
||||||
item: widget.model.item,
|
|
||||||
changeMenuStyle: () async {},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return const SizedBox();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class MenuListViewComponentModel extends FlutterFlowModel<MenuListViewComponentWidget> {
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentModel extends FlutterFlowModel<MenuStaggeredViewComponentWidget> {
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,193 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
|
||||||
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_util.dart';
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
|
||||||
const MenuStaggeredViewComponentWidget(
|
|
||||||
{super.key,
|
|
||||||
required this.changeMenuStyle,
|
|
||||||
required this.expandable,
|
|
||||||
required this.item,
|
|
||||||
required this.options,
|
|
||||||
required this.isGrid});
|
|
||||||
|
|
||||||
final bool expandable;
|
|
||||||
final MenuItem item;
|
|
||||||
final bool isGrid;
|
|
||||||
|
|
||||||
final List<MenuEntry?> options;
|
|
||||||
final Future Function()? changeMenuStyle;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MenuStaggeredViewComponentWidget> createState() => _MenuStaggeredViewComponentWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MenuStaggeredViewComponentWidgetState extends State<MenuStaggeredViewComponentWidget> {
|
|
||||||
late MenuStaggeredViewComponentModel _model;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
_model.onUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_model = createModel(context, () => MenuStaggeredViewComponentModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.maybeDispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final textScaler = MediaQuery.textScalerOf(context);
|
|
||||||
final double scaledFontSize = 14 * textScaler.scale(1);
|
|
||||||
final int crossAxisCount = scaledFontSize >= 26
|
|
||||||
? 1
|
|
||||||
: scaledFontSize >= 18
|
|
||||||
? 2
|
|
||||||
: 3;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
GridView.builder(
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: crossAxisCount,
|
|
||||||
crossAxisSpacing: 10.0,
|
|
||||||
mainAxisSpacing: 10.0,
|
|
||||||
childAspectRatio: 1,
|
|
||||||
mainAxisExtent: 100,
|
|
||||||
),
|
|
||||||
itemCount: widget.options.length,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Container(
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(0),
|
|
||||||
color: Colors.transparent,
|
|
||||||
boxShadow: const [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.transparent,
|
|
||||||
blurRadius: 4,
|
|
||||||
offset: Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Center(child: widget.options[index]),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
].addToStart(const SizedBox(height: 30)).addToEnd(const SizedBox(height: 30)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget collapseExpandMethod(BuildContext context) {
|
|
||||||
if (widget.isGrid == true) {
|
|
||||||
return Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(0.0),
|
|
||||||
topRight: Radius.circular(0.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Minimize',
|
|
||||||
ptText: 'Minimizar',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).title1.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 12.0,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontStyle: FontStyle.normal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 50.0,
|
|
||||||
fillColor: const Color(0x00FFFFFF),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_up_sharp,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
await widget.changeMenuStyle?.call();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Expand',
|
|
||||||
ptText: 'Expandir',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).title1.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 12.0,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontStyle: FontStyle.normal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 0.0,
|
|
||||||
buttonSize: 50.0,
|
|
||||||
fillColor: const Color(0x00FFFFFF),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_down_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
await widget.changeMenuStyle?.call();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +1,44 @@
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
// import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
// import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
// import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'message_well_component_widget.dart' show MessageWellComponentWidget;
|
// import 'message_well_component_widget.dart' show MessageWellComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class MessageWellComponentModel extends FlutterFlowModel<MessageWellComponentWidget> {
|
// class MessageWellComponentModel extends FlutterFlowModel<MessageWellComponentWidget> {
|
||||||
final unfocusNode = FocusNode();
|
// final unfocusNode = FocusNode();
|
||||||
// State field(s) for TextField widget.
|
// // State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode;
|
// FocusNode? textFieldFocusNode;
|
||||||
TextEditingController? textController;
|
// TextEditingController? textController;
|
||||||
String? Function(BuildContext, String?)? textControllerValidator;
|
// String? Function(BuildContext, String?)? textControllerValidator;
|
||||||
|
|
||||||
/// Query cache managers for this widget.
|
// /// Query cache managers for this widget.
|
||||||
|
|
||||||
final _getLiberationsManager = StreamRequestManager<ApiCallResponse>();
|
// final _getLiberationsManager = StreamRequestManager<ApiCallResponse>();
|
||||||
Stream<ApiCallResponse> getLiberations({
|
// Stream<ApiCallResponse> getLiberations({
|
||||||
String? uniqueQueryKey,
|
// String? uniqueQueryKey,
|
||||||
bool? overrideCache,
|
// bool? overrideCache,
|
||||||
required Stream<ApiCallResponse> Function() requestFn,
|
// required Stream<ApiCallResponse> Function() requestFn,
|
||||||
}) =>
|
// }) =>
|
||||||
_getLiberationsManager.performRequest(
|
// _getLiberationsManager.performRequest(
|
||||||
uniqueQueryKey: uniqueQueryKey,
|
// uniqueQueryKey: uniqueQueryKey,
|
||||||
overrideCache: overrideCache,
|
// overrideCache: overrideCache,
|
||||||
requestFn: requestFn,
|
// requestFn: requestFn,
|
||||||
);
|
// );
|
||||||
void clearGetLiberationsCache() => _getLiberationsManager.clear();
|
// void clearGetLiberationsCache() => _getLiberationsManager.clear();
|
||||||
void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey);
|
// void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey);
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void initState(BuildContext context) {}
|
// void initState(BuildContext context) {}
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void dispose() {
|
// void dispose() {
|
||||||
unfocusNode.dispose();
|
// unfocusNode.dispose();
|
||||||
textFieldFocusNode?.dispose();
|
// textFieldFocusNode?.dispose();
|
||||||
textController?.dispose();
|
// textController?.dispose();
|
||||||
|
|
||||||
/// Dispose query cache managers for this widget.
|
// /// Dispose query cache managers for this widget.
|
||||||
|
|
||||||
clearGetLiberationsCache();
|
// clearGetLiberationsCache();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
|
@ -1,379 +1,379 @@
|
||||||
import 'dart:async';
|
// import 'dart:async';
|
||||||
import 'dart:collection';
|
// import 'dart:collection';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
// import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
// import 'package:hub/backend/api_requests/api_calls.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:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
// import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
//
|
// //
|
||||||
|
|
||||||
final dropdown = BehaviorSubject<LinkedHashMap<String, String>>.seeded(
|
// final dropdown = BehaviorSubject<LinkedHashMap<String, String>>.seeded(
|
||||||
LinkedHashMap.from({
|
// LinkedHashMap.from({
|
||||||
'All': 'A',
|
// 'All': 'A',
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
|
|
||||||
class MessageWellComponentWidget extends StatefulWidget {
|
// class MessageWellComponentWidget extends StatefulWidget {
|
||||||
const MessageWellComponentWidget({super.key});
|
// const MessageWellComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
State<MessageWellComponentWidget> createState() => _MessageWellComponentWidgetState();
|
// State<MessageWellComponentWidget> createState() => _MessageWellComponentWidgetState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget> {
|
// class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget> {
|
||||||
StreamSubscription? _dropdownSubscription;
|
// StreamSubscription? _dropdownSubscription;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
super.initState();
|
// super.initState();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
context.read<MessageWellNotifier>().fetchMessages();
|
// context.read<MessageWellNotifier>().fetchMessages();
|
||||||
});
|
// });
|
||||||
|
|
||||||
_dropdownSubscription = dropdown.stream.listen((_) {
|
// _dropdownSubscription = dropdown.stream.listen((_) {
|
||||||
context.read<MessageWellNotifier>().fetchMessages();
|
// context.read<MessageWellNotifier>().fetchMessages();
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void dispose() {
|
// void dispose() {
|
||||||
_dropdownSubscription?.cancel();
|
// _dropdownSubscription?.cancel();
|
||||||
super.dispose();
|
// super.dispose();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final messages = context.read<MessageWellNotifier>().getMessages();
|
// final messages = context.read<MessageWellNotifier>().getMessages();
|
||||||
return Align(
|
// return Align(
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 40.0),
|
// padding: const EdgeInsets.symmetric(vertical: 40.0),
|
||||||
child: SizedBox(
|
// child: SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.8,
|
// height: MediaQuery.of(context).size.height * 0.8,
|
||||||
child: Column(
|
// child: Column(
|
||||||
children: [
|
// children: [
|
||||||
_buildHandleMessageWell(context, FlutterFlowTheme.of(context)),
|
// _buildHandleMessageWell(context, FlutterFlowTheme.of(context)),
|
||||||
_buildMenuMessageWell(context, FlutterFlowTheme.of(context)),
|
// _buildMenuMessageWell(context, FlutterFlowTheme.of(context)),
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: ListView.builder(
|
// child: ListView.builder(
|
||||||
itemCount: messages.length,
|
// itemCount: messages.length,
|
||||||
shrinkWrap: true,
|
// shrinkWrap: true,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
// physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) {
|
// itemBuilder: (context, index) {
|
||||||
var message = messages[index];
|
// var message = messages[index];
|
||||||
return _buildMessageItem(context, message, index);
|
// return _buildMessageItem(context, message, index);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
// Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
||||||
final dropdownItems = LinkedHashMap.from({
|
// final dropdownItems = LinkedHashMap.from({
|
||||||
'All': 'A',
|
// 'All': 'A',
|
||||||
'Personal': 'O',
|
// 'Personal': 'O',
|
||||||
'Global': 'C',
|
// 'Global': 'C',
|
||||||
});
|
// });
|
||||||
return SizedBox(
|
// return SizedBox(
|
||||||
key: UniqueKey(),
|
// key: UniqueKey(),
|
||||||
width: 200,
|
// width: 200,
|
||||||
height: 40,
|
// height: 40,
|
||||||
child: StreamBuilder<String>(
|
// child: StreamBuilder<String>(
|
||||||
stream: dropdown.stream.map((event) => event.keys.first),
|
// stream: dropdown.stream.map((event) => event.keys.first),
|
||||||
builder: (context, snapshot) {
|
// builder: (context, snapshot) {
|
||||||
final value = snapshot.data;
|
// final value = snapshot.data;
|
||||||
return DropdownButtonFormField<String>(
|
// return DropdownButtonFormField<String>(
|
||||||
value: value,
|
// value: value,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10.0),
|
// contentPadding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
errorBorder: OutlineInputBorder(
|
// errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.error,
|
// color: theme.error,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
enabledBorder: OutlineInputBorder(
|
// enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.primary,
|
// color: theme.primary,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
focusedBorder: OutlineInputBorder(
|
// focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.primary,
|
// color: theme.primary,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
disabledBorder: OutlineInputBorder(
|
// disabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.primary,
|
// color: theme.primary,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
// focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.error,
|
// color: theme.error,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
border: OutlineInputBorder(
|
// border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
// borderSide: BorderSide(
|
||||||
color: theme.primary,
|
// color: theme.primary,
|
||||||
width: 2,
|
// width: 2,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
filled: true,
|
// filled: true,
|
||||||
fillColor: theme.primary,
|
// fillColor: theme.primary,
|
||||||
),
|
// ),
|
||||||
onChanged: (String? newValue) {
|
// onChanged: (String? newValue) {
|
||||||
safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()}));
|
// safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()}));
|
||||||
},
|
// },
|
||||||
items: dropdownItems.entries
|
// items: dropdownItems.entries
|
||||||
.map((entry) => DropdownMenuItem<String>(
|
// .map((entry) => DropdownMenuItem<String>(
|
||||||
value: entry.key,
|
// value: entry.key,
|
||||||
child: Text(entry.key),
|
// child: Text(entry.key),
|
||||||
))
|
// ))
|
||||||
.toList(),
|
// .toList(),
|
||||||
style: theme.bodyMedium.copyWith(
|
// style: theme.bodyMedium.copyWith(
|
||||||
color: theme.primaryText,
|
// color: theme.primaryText,
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
Text _buildHandleMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
// Text _buildHandleMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
||||||
return Text(
|
// return Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
// FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Mural de Mensagens',
|
// ptText: 'Mural de Mensagens',
|
||||||
enText: 'Message Wall',
|
// enText: 'Message Wall',
|
||||||
),
|
// ),
|
||||||
style: theme.bodyMedium.copyWith(
|
// style: theme.bodyMedium.copyWith(
|
||||||
fontFamily: 'Nunito Sans',
|
// fontFamily: 'Nunito Sans',
|
||||||
letterSpacing: 0.0,
|
// letterSpacing: 0.0,
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
Widget _buildMessageItem(BuildContext context, dynamic message, int index) {
|
// Widget _buildMessageItem(BuildContext context, dynamic message, int index) {
|
||||||
FlutterFlowTheme.of(context);
|
// FlutterFlowTheme.of(context);
|
||||||
String formatMessageOrigin(String messageOrigin) {
|
// String formatMessageOrigin(String messageOrigin) {
|
||||||
final words = messageOrigin.split(' ');
|
// final words = messageOrigin.split(' ');
|
||||||
final formattedWords = words.map((word) {
|
// final formattedWords = words.map((word) {
|
||||||
if (word.isEmpty) return word; // Handle empty words
|
// if (word.isEmpty) return word; // Handle empty words
|
||||||
final firstLetter = word.substring(0, 1).toUpperCase();
|
// final firstLetter = word.substring(0, 1).toUpperCase();
|
||||||
final remainingLetters = word.length > 1 ? word.substring(1).toLowerCase() : '';
|
// final remainingLetters = word.length > 1 ? word.substring(1).toLowerCase() : '';
|
||||||
return '$firstLetter$remainingLetters';
|
// return '$firstLetter$remainingLetters';
|
||||||
});
|
// });
|
||||||
return formattedWords.join(' ');
|
// return formattedWords.join(' ');
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Padding(
|
// return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
// padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||||
child: Card(
|
// child: Card(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
// color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: Container(
|
// child: Container(
|
||||||
// height: 100,
|
// // height: 100,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
// child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
// children: [
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
// padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
message['MSG_DESTINO_TP'] == 'T'
|
|
||||||
? Icons.language
|
|
||||||
: message['MSG_DESTINO_TP'] == 'P'
|
|
||||||
? Icons.person
|
|
||||||
: Icons.home,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 25,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
message['MSG_ORIGEM_DESC'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 15,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.fade,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(width: 10)),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 5),
|
|
||||||
child: Icon(
|
|
||||||
Icons.history,
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
size: 15,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
message['MSG_DATE'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 10,
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(width: 15)),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 5),
|
|
||||||
child: Icon(
|
|
||||||
Icons.message,
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
size: 15,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
message['MSG_TEXTO'].toString(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(width: 15)),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(height: 4)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// Row(
|
// Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
// children: [
|
// children: [
|
||||||
// Icon(
|
// Icon(
|
||||||
|
// message['MSG_DESTINO_TP'] == 'T'
|
||||||
|
// ? Icons.language
|
||||||
|
// : message['MSG_DESTINO_TP'] == 'P'
|
||||||
|
// ? Icons.person
|
||||||
|
// : Icons.home,
|
||||||
|
// color: FlutterFlowTheme.of(context).primary,
|
||||||
|
// size: 25,
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: Text(
|
||||||
|
// message['MSG_ORIGEM_DESC'].toString(),
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontWeight: FontWeight.bold,
|
||||||
|
// fontSize: 15,
|
||||||
|
// color: FlutterFlowTheme.of(context).primary,
|
||||||
|
// ),
|
||||||
|
// overflow: TextOverflow.fade,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ].divide(const SizedBox(width: 10)),
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Padding(
|
||||||
|
// padding: const EdgeInsets.only(left: 5),
|
||||||
|
// child: Icon(
|
||||||
|
// Icons.history,
|
||||||
|
// color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
// size: 15,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: Text(
|
||||||
|
// message['MSG_DATE'].toString(),
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontWeight: FontWeight.bold,
|
||||||
|
// fontSize: 10,
|
||||||
|
// color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
// ),
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ].divide(const SizedBox(width: 15)),
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Padding(
|
||||||
|
// padding: const EdgeInsets.only(left: 5),
|
||||||
|
// child: Icon(
|
||||||
// Icons.message,
|
// Icons.message,
|
||||||
// color: FlutterFlowTheme.of(context).customColor6,
|
// color: FlutterFlowTheme.of(context).customColor6,
|
||||||
// size: 15,
|
// size: 15,
|
||||||
// ),
|
// ),
|
||||||
|
// ),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// message['MSG_TEXTO'].toString(),
|
// message['MSG_TEXTO'].toString(),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
// ].divide(const SizedBox(width: 15)),
|
||||||
// ),
|
// ),
|
||||||
// ]
|
// ].divide(const SizedBox(height: 4)),
|
||||||
// .addToStart(const SizedBox(width: 8))
|
// ),
|
||||||
// .addToEnd(const SizedBox(width: 8))),
|
// ),
|
||||||
].divide(
|
// // Row(
|
||||||
const SizedBox(height: 8),
|
// // children: [
|
||||||
),
|
// // Icon(
|
||||||
),
|
// // Icons.message,
|
||||||
),
|
// // color: FlutterFlowTheme.of(context).customColor6,
|
||||||
),
|
// // size: 15,
|
||||||
));
|
// // ),
|
||||||
}
|
// // Expanded(
|
||||||
}
|
// // child: Padding(
|
||||||
|
// // padding: const EdgeInsets.all(8.0),
|
||||||
|
// // child: Text(
|
||||||
|
// // message['MSG_TEXTO'].toString(),
|
||||||
|
// // ),
|
||||||
|
// // ),
|
||||||
|
// // ),
|
||||||
|
// // ]
|
||||||
|
// // .addToStart(const SizedBox(width: 8))
|
||||||
|
// // .addToEnd(const SizedBox(width: 8))),
|
||||||
|
// ].divide(
|
||||||
|
// const SizedBox(height: 8),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
class MessageWellState {
|
// class MessageWellState {
|
||||||
final List<dynamic> messages;
|
// final List<dynamic> messages;
|
||||||
int pageNumber;
|
// int pageNumber;
|
||||||
final bool allowScrollInSingleChildScrollView;
|
// final bool allowScrollInSingleChildScrollView;
|
||||||
|
|
||||||
MessageWellState({
|
// MessageWellState({
|
||||||
required this.messages,
|
// required this.messages,
|
||||||
this.pageNumber = 1,
|
// this.pageNumber = 1,
|
||||||
required this.allowScrollInSingleChildScrollView,
|
// required this.allowScrollInSingleChildScrollView,
|
||||||
});
|
// });
|
||||||
|
|
||||||
MessageWellState copyWith({
|
// MessageWellState copyWith({
|
||||||
List<dynamic>? messages,
|
// List<dynamic>? messages,
|
||||||
int? pageNumber,
|
// int? pageNumber,
|
||||||
bool? allowScrollInSingleChildScrollView,
|
// bool? allowScrollInSingleChildScrollView,
|
||||||
}) {
|
// }) {
|
||||||
return MessageWellState(
|
// return MessageWellState(
|
||||||
messages: messages ?? this.messages,
|
// messages: messages ?? this.messages,
|
||||||
pageNumber: pageNumber ?? this.pageNumber,
|
// pageNumber: pageNumber ?? this.pageNumber,
|
||||||
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? this.allowScrollInSingleChildScrollView,
|
// allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? this.allowScrollInSingleChildScrollView,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
// class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
var _totalPageNumber = 1;
|
// var _totalPageNumber = 1;
|
||||||
int get totalPageNumber => _totalPageNumber;
|
// int get totalPageNumber => _totalPageNumber;
|
||||||
|
|
||||||
set totalPageNumber(int value) {
|
// set totalPageNumber(int value) {
|
||||||
_totalPageNumber = value;
|
// _totalPageNumber = value;
|
||||||
}
|
// }
|
||||||
|
|
||||||
MessageWellNotifier()
|
// MessageWellNotifier()
|
||||||
: super(MessageWellState(
|
// : super(MessageWellState(
|
||||||
messages: [],
|
// messages: [],
|
||||||
allowScrollInSingleChildScrollView: true,
|
// allowScrollInSingleChildScrollView: true,
|
||||||
)) {
|
// )) {
|
||||||
fetchMessages();
|
// fetchMessages();
|
||||||
}
|
// }
|
||||||
|
|
||||||
void fetchMessages() async {
|
// void fetchMessages() async {
|
||||||
if (state.pageNumber <= totalPageNumber) {
|
// if (state.pageNumber <= totalPageNumber) {
|
||||||
var apiCall = GetMessagesCall();
|
// var apiCall = GetMessagesCall();
|
||||||
var response = await apiCall.call(
|
// var response = await apiCall.call(
|
||||||
pageSize: '100',
|
// pageSize: '100',
|
||||||
pageNumber: state.pageNumber.toString(),
|
// pageNumber: state.pageNumber.toString(),
|
||||||
tipoDestino: dropdown.value.values.first,
|
// tipoDestino: dropdown.value.values.first,
|
||||||
);
|
// );
|
||||||
if (response.statusCode == 200) {
|
// if (response.statusCode == 200) {
|
||||||
var messagesData = response.jsonBody['mensagens'];
|
// var messagesData = response.jsonBody['mensagens'];
|
||||||
var newMessages = [...state.messages, ...messagesData];
|
// var newMessages = [...state.messages, ...messagesData];
|
||||||
state = state.copyWith(messages: newMessages);
|
// state = state.copyWith(messages: newMessages);
|
||||||
// var rExp = RegExp(r'\d+')
|
// // var rExp = RegExp(r'\d+')
|
||||||
// .allMatches(newMessages.toString())
|
// // .allMatches(newMessages.toString())
|
||||||
// .map((e) => e.group(0))
|
// // .map((e) => e.group(0))
|
||||||
// .toList();
|
// // .toList();
|
||||||
// Provider.of<MessageCounter>(context, listen: false).setCounter(int.parse(response.jsonBody['total_pages']));
|
// // Provider.of<MessageCounter>(context, listen: false).setCounter(int.parse(response.jsonBody['total_pages']));
|
||||||
// totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
// // totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
||||||
} else {}
|
// } else {}
|
||||||
} else {}
|
// } else {}
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<dynamic> getMessages() {
|
// List<dynamic> getMessages() {
|
||||||
return state.messages;
|
// return state.messages;
|
||||||
}
|
// }
|
||||||
|
|
||||||
void incrementPageNumber() {
|
// void incrementPageNumber() {
|
||||||
if (state.pageNumber <= totalPageNumber) {
|
// if (state.pageNumber <= totalPageNumber) {
|
||||||
state = state.copyWith(pageNumber: state.pageNumber + 1);
|
// state = state.copyWith(pageNumber: state.pageNumber + 1);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
final messageWellProvider = StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
// final messageWellProvider = StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||||
return MessageWellNotifier();
|
// return MessageWellNotifier();
|
||||||
});
|
// });
|
||||||
|
|
|
@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
// ignore: unused_import
|
// ignore: unused_import
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
@ -56,9 +57,9 @@ class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidge
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -16,10 +16,10 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -32,9 +32,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -3,8 +3,8 @@ 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/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/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';
|
||||||
|
@ -49,7 +49,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
_accessPass = await StorageHelper().get(SecureStorageKey.accessPass.value, Storage.SecureStorage) ?? '';
|
_accessPass = await StorageHelper().get(SecureStorageKey.accessPass.value) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class LiberationHistoryItemDetailsTemplateComponentModel
|
class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||||
|
@ -27,9 +27,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ import 'package:flutter/material.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/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
String devUUID = '';
|
String devUUID = '';
|
||||||
String userUUID = '';
|
String userUUID = '';
|
||||||
String cliName = '';
|
String ownerName = '';
|
||||||
String ownerUUID = '';
|
String ownerUUID = '';
|
||||||
VoidCallback? setState;
|
VoidCallback? setState;
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
DateTime currentDateTime = DateTime.now().add(const Duration(minutes: 59));
|
DateTime currentDateTime = DateTime.now().add(const Duration(minutes: 59));
|
||||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
try {
|
try {
|
||||||
log('dateTimeTextController.text: ${dateTimeTextController.text}');
|
|
||||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -138,12 +137,11 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
||||||
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
setState?.call();
|
setState?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
model.cliName,
|
model.ownerName,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
|
@ -129,9 +129,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
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/term_of_use/atom_terms_of_use.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -215,8 +215,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -263,12 +262,10 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
validator:
|
validator: _model.emailAddressTextControllerValidator.asValidator(context),
|
||||||
_model.emailAddressTextControllerValidator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -281,27 +278,23 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
controller: _model.passwordTextController,
|
controller: _model.passwordTextController,
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
focusNode: _model.passwordFocusNode,
|
focusNode: _model.passwordFocusNode,
|
||||||
onChanged: (_) => EasyDebounce.debounce('_model.passwordTextController',
|
onChanged: (_) => EasyDebounce.debounce('_model.passwordTextController', const Duration(milliseconds: 500), () => setState(() {})),
|
||||||
const Duration(milliseconds: 500), () => setState(() {})),
|
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
autofillHints: const [AutofillHints.password],
|
autofillHints: const [AutofillHints.password],
|
||||||
textInputAction: TextInputAction.send,
|
textInputAction: TextInputAction.send,
|
||||||
obscureText: !_model.passwordVisibility,
|
obscureText: !_model.passwordVisibility,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
||||||
FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).customColor1, width: 0.25),
|
||||||
color: FlutterFlowTheme.of(context).customColor1, width: 0.25),
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
|
@ -310,9 +303,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), borderRadius: BorderRadius.circular(12.0)),
|
||||||
const BorderSide(color: Color(0xFF1AAB5F), width: 0.25),
|
|
||||||
borderRadius: BorderRadius.circular(12.0)),
|
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -324,15 +315,10 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
onTap: () => setState(
|
onTap: () => setState(() => _model.passwordVisibility = !_model.passwordVisibility),
|
||||||
() => _model.passwordVisibility = !_model.passwordVisibility),
|
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(_model.passwordVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
_model.passwordVisibility
|
color: FlutterFlowTheme.of(context).accent1, size: 24.0),
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
size: 24.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
|
@ -341,8 +327,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.passwordTextControllerValidator.asValidator(context),
|
validator: _model.passwordTextControllerValidator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
@ -377,8 +362,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -386,8 +370,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -409,8 +392,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).customColor1,
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -418,8 +400,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
|
@ -453,22 +434,15 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
await DialogUtil.errorDefault(context);
|
await DialogUtil.errorDefault(context);
|
||||||
LogUtil.requestAPIFailed(
|
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s);
|
||||||
'login.php',
|
|
||||||
_model.emailAddressTextController.text,
|
|
||||||
"Login",
|
|
||||||
e,
|
|
||||||
s);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText('1x926nsn'),
|
text: FFLocalizations.of(context).getText('1x926nsn'),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -476,8 +450,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
@ -497,15 +470,12 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('toggleSignUpPage'),
|
key: const ValueKey<String>('toggleSignUpPage'),
|
||||||
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */),
|
||||||
.getText('jwvd4ai1' /* Cadastrar */),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).customColor1,
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -513,8 +483,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
@ -565,16 +534,14 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */),
|
||||||
.getText('p5c6d54y' /* Recupere aqui */),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
mouseCursor: SystemMouseCursors.click,
|
mouseCursor: SystemMouseCursors.click,
|
||||||
)
|
)
|
||||||
|
@ -582,8 +549,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize),
|
fontSize: limitedInputFontSize),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
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/term_of_use/atom_terms_of_use.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_animations.dart';
|
import '/flutter_flow/flutter_flow_animations.dart';
|
||||||
|
@ -91,7 +91,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
_deviceType = (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
_deviceType = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -111,9 +111,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
|
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
|
||||||
|
|
||||||
bool isFormInvalid() {
|
bool isFormInvalid() {
|
||||||
if (_model.nameRegisterFormTextController.text == '' ||
|
if (_model.nameRegisterFormTextController.text == '' || _model.emailRegisterFormTextController.text == '' || _model.passwordRegisterFormTextController.text == '') {
|
||||||
_model.emailRegisterFormTextController.text == '' ||
|
|
||||||
_model.passwordRegisterFormTextController.text == '') {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,8 +238,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -292,11 +289,9 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.nameRegisterFormTextControllerValidator
|
validator: _model.nameRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -327,8 +322,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -379,12 +373,10 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
validator: _model.emailRegisterFormTextControllerValidator
|
validator: _model.emailRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -415,8 +407,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -458,14 +449,11 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
||||||
onTap: () => setState(
|
onTap: () => setState(
|
||||||
() => _model.passwordRegisterFormVisibility =
|
() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility,
|
||||||
!_model.passwordRegisterFormVisibility,
|
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_model.passwordRegisterFormVisibility
|
_model.passwordRegisterFormVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
|
@ -477,11 +465,9 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.passwordRegisterFormTextControllerValidator
|
validator: _model.passwordRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -575,16 +561,14 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -37,9 +37,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ import 'package:flutter/material.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/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -35,9 +35,9 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,7 +341,6 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
|
|
||||||
Future<void> sendVisitors(BuildContext context) async {
|
Future<void> sendVisitors(BuildContext context) async {
|
||||||
await widget.getVisitors?.call(_model.visitors);
|
await widget.getVisitors?.call(_model.visitors);
|
||||||
log('() => docs: ${_model.docs}');
|
|
||||||
await widget.getDocs?.call(_model.docs);
|
await widget.getDocs?.call(_model.docs);
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
|
class DeadCode {
|
||||||
|
final String? desc;
|
||||||
|
|
||||||
|
const DeadCode([this.desc = '']);
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'pages/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
|
import '../../../../shared/components/molecules/locals/index.dart';
|
||||||
|
import 'index.dart';
|
||||||
|
|
||||||
|
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||||
|
late StreamSubscription<bool> _completer;
|
||||||
|
|
||||||
|
HomeBloc() : super(HomeState()) {
|
||||||
|
on<HomeEvent>(_onHomeEvent);
|
||||||
|
_completer = LocalsRepositoryImpl.license.stream.listen((v) {
|
||||||
|
add(HomeEvent());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onHomeEvent(HomeEvent event, Emitter<HomeState> emit) async {
|
||||||
|
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
|
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
|
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
|
final userName = (await StorageHelper().get(KeychainStorageKey.userName.value)) ?? '';
|
||||||
|
final userEmail = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||||
|
|
||||||
|
emit(state.copyWith(
|
||||||
|
devUUID: devUUID,
|
||||||
|
userUUID: userUUID,
|
||||||
|
cliUUID: cliUUID,
|
||||||
|
userName: userName,
|
||||||
|
userEmail: userEmail,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
class HomeEvent {}
|
|
@ -0,0 +1,35 @@
|
||||||
|
class HomeState {
|
||||||
|
final bool isGrid;
|
||||||
|
final String devUUID;
|
||||||
|
final String cliUUID;
|
||||||
|
final String userUUID;
|
||||||
|
final String userName;
|
||||||
|
final String userEmail;
|
||||||
|
|
||||||
|
HomeState({
|
||||||
|
this.isGrid = false,
|
||||||
|
this.devUUID = '',
|
||||||
|
this.cliUUID = '',
|
||||||
|
this.userUUID = '',
|
||||||
|
this.userName = '',
|
||||||
|
this.userEmail = '',
|
||||||
|
});
|
||||||
|
|
||||||
|
HomeState copyWith({
|
||||||
|
bool? isGrid,
|
||||||
|
String? devUUID,
|
||||||
|
String? cliUUID,
|
||||||
|
String? userUUID,
|
||||||
|
String? userName,
|
||||||
|
String? userEmail,
|
||||||
|
}) {
|
||||||
|
return HomeState(
|
||||||
|
isGrid: isGrid ?? this.isGrid,
|
||||||
|
devUUID: devUUID ?? this.devUUID,
|
||||||
|
cliUUID: cliUUID ?? this.cliUUID,
|
||||||
|
userUUID: userUUID ?? this.userUUID,
|
||||||
|
userName: userName ?? this.userName,
|
||||||
|
userEmail: userEmail ?? this.userEmail,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'home_bloc.dart';
|
||||||
|
export 'home_events.dart';
|
||||||
|
export 'home_state.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'pages/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -1,61 +1,66 @@
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
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/shared/components/molecules/drawer/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/widgets/drawer_widget/drawer_widget.dart';
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
|
||||||
class HomePageWidget extends StatefulWidget {
|
class HomePageWidget extends StatefulWidget {
|
||||||
const HomePageWidget({super.key});
|
const HomePageWidget(this.update, {super.key});
|
||||||
|
final Future<bool> Function(BuildContext context)? update;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HomePageWidget> createState() => _HomePageWidgetState();
|
State<HomePageWidget> createState() => _HomePageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageWidgetState extends State<HomePageWidget> {
|
class _HomePageWidgetState extends State<HomePageWidget> with WidgetsBindingObserver {
|
||||||
late HomePageModel _model;
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
late LocalProfileComponentWidget _localProfileComponentWidget;
|
|
||||||
|
|
||||||
_HomePageWidgetState() {
|
|
||||||
_localProfileComponentWidget = LocalProfileComponentWidget();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
_model.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
_model = createModel(context, () => HomePageModel(safeSetState: () => safeSetState(() {})));
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
await LocalsRepositoryImpl().check(context);
|
||||||
_model.textController ??= TextEditingController();
|
if (widget.update != null) {
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
await widget.update!(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
StorageHelper().context = context;
|
return Builder(
|
||||||
|
builder: (context) {
|
||||||
|
// LocalsRepositoryImpl.license.add(false);
|
||||||
|
// context.read<LocalProfileBloc>().add(LocalProfileEvent());
|
||||||
|
// context.read<MenuBloc>().add(MenuEvent());
|
||||||
|
LocalsRepositoryImpl.license.add(true);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
// drawer: buildDrawer(context),
|
|
||||||
drawerEnableOpenDragGesture: true,
|
drawerEnableOpenDragGesture: true,
|
||||||
drawerDragStartBehavior: DragStartBehavior.start,
|
drawerDragStartBehavior: DragStartBehavior.start,
|
||||||
drawer: CustomDrawer(model: _model),
|
drawer: CustomDrawer(),
|
||||||
appBar: buildAppBar(context),
|
appBar: buildAppBar(context),
|
||||||
body: buildPage(context),
|
body: buildPage(context),
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppBar buildAppBar(BuildContext context) {
|
AppBar buildAppBar(BuildContext context) {
|
||||||
|
@ -139,25 +144,18 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
Widget buildBody() {
|
Widget buildBody() {
|
||||||
return Container(
|
return Container(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: wrapWithModel(
|
|
||||||
model: _model.homeMenuComponentModel,
|
|
||||||
updateOnChange: true,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 40),
|
padding: const EdgeInsets.only(bottom: 40),
|
||||||
child: MenuComponentWidget(
|
child: Menufactory(
|
||||||
model: _model.homeMenuComponentModel,
|
entry: MenuEntry.getEntriesByType(MenuEntryType.Home),
|
||||||
),
|
item: EnumMenuItem.button,
|
||||||
|
view: MenuView.list_grid,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildLocal() {
|
Widget buildLocal() {
|
||||||
return wrapWithModel(
|
return LocalProfileComponentWidget();
|
||||||
model: _model.localComponentModel,
|
|
||||||
updateCallback: () => safeSetState(() {}),
|
|
||||||
child: _localProfileComponentWidget,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export 'home_page.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'pages/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -1,12 +1,31 @@
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/backend/schema/enums/enums.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.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/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/about_property_page/about_property_model.dart';
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
|
class AboutPropertyModel extends FlutterFlowModel<AboutPropertyPage> {
|
||||||
|
dynamic item;
|
||||||
|
|
||||||
|
VoidCallback? safeSetState;
|
||||||
|
|
||||||
|
Future<void> initAsync() async {
|
||||||
|
safeSetState?.call();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState(BuildContext context) {
|
||||||
|
initAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {}
|
||||||
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class AboutPropertyPage extends StatefulWidget {
|
class AboutPropertyPage extends StatefulWidget {
|
||||||
|
@ -43,15 +62,11 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> with SingleTicker
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(appBar: _buildAppBar(context), backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: _buildBody(context));
|
||||||
appBar: _buildAppBar(context),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
body: _buildBody(context));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||||
final String title =
|
final String title = FFLocalizations.of(context).getVariableText(ptText: "Sobre a Propriedade", enText: "About the Property");
|
||||||
FFLocalizations.of(context).getVariableText(ptText: "Sobre a Propriedade", enText: "About the Property");
|
|
||||||
return AppBarUtil(
|
return AppBarUtil(
|
||||||
title: title,
|
title: title,
|
||||||
onBackButtonPressed: () => context.pop(),
|
onBackButtonPressed: () => context.pop(),
|
||||||
|
@ -62,13 +77,10 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> with SingleTicker
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: wrapWithModel(
|
child: Menufactory(
|
||||||
model: _model.menuComponentModel,
|
entry: MenuEntry.getEntriesByType(MenuEntryType.Property),
|
||||||
updateCallback: () => setState(() {}),
|
item: EnumMenuItem.button,
|
||||||
child: Padding(
|
view: MenuView.list_grid,
|
||||||
padding: EdgeInsets.only(bottom: 40),
|
|
||||||
child: MenuComponentWidget(model: _model.menuComponentModel),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
export 'about_property_screen.dart';
|
|
@ -33,6 +33,25 @@ String jsonListToStr(List<dynamic> visitorList) {
|
||||||
return result.substring(0, result.length - 1);
|
return result.substring(0, result.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<Map<String, String>> stringToMap(String v) async {
|
||||||
|
try {
|
||||||
|
return Future.value(Map.fromEntries(
|
||||||
|
v.split(',').map((part) {
|
||||||
|
final keyValue = part.split(':');
|
||||||
|
if (keyValue.length < 2) {
|
||||||
|
throw FormatException('Invalid key-value pair: $part of $v');
|
||||||
|
}
|
||||||
|
final key = keyValue[0].trim();
|
||||||
|
final value = keyValue.sublist(1).join(':').trim(); // Join the remaining parts to handle DateTime correctly
|
||||||
|
return MapEntry(key, value);
|
||||||
|
}),
|
||||||
|
));
|
||||||
|
} catch (e) {
|
||||||
|
print('Error parsing string to map: $e');
|
||||||
|
return Future.value({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<dynamic> listStrJsonToJsonList(
|
List<dynamic> listStrJsonToJsonList(
|
||||||
dynamic jsonList,
|
dynamic jsonList,
|
||||||
List<String> strList,
|
List<String> strList,
|
||||||
|
|
|
@ -4,14 +4,14 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/schema/util/schema_util.dart';
|
import 'package:hub/backend/schema/util/schema_util.dart';
|
||||||
|
import 'package:hub/features/home/index.dart';
|
||||||
|
import 'package:hub/features/property/index.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/pages/about_property_page/about_property_screen.dart';
|
|
||||||
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
||||||
import 'package:hub/pages/delivery_schedule_page/delivery_schedule_widget.dart';
|
import 'package:hub/pages/delivery_schedule_page/delivery_schedule_widget.dart';
|
||||||
import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart';
|
import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart';
|
||||||
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
||||||
import 'package:hub/pages/home_page/home_page_widget.dart';
|
|
||||||
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
import 'package:hub/pages/package_order_page/package_order_page.dart';
|
import 'package:hub/pages/package_order_page/package_order_page.dart';
|
||||||
|
@ -24,14 +24,16 @@ import 'package:hub/pages/qr_code_page/qr_code_page_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/register_visitor_page/register_visitor_page_widget.dart';
|
import 'package:hub/pages/register_visitor_page/register_visitor_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/pages/residents_on_the_property/residents_on_the_property_screen.dart';
|
||||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
import 'package:hub/pages/sign_in_page/sign_in_page_widget.dart';
|
import 'package:hub/pages/sign_in_page/sign_in_page_widget.dart';
|
||||||
import 'package:hub/pages/sign_up_page/sign_up_page_widget.dart';
|
import 'package:hub/pages/sign_up_page/sign_up_page_widget.dart';
|
||||||
import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart';
|
import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart';
|
||||||
import 'package:hub/pages/visits_on_the_property/visits_on_the_property_screen.dart';
|
import 'package:hub/pages/visits_on_the_property/visits_on_the_property_screen.dart';
|
||||||
import 'package:hub/pages/welcome_page/welcome_page_widget.dart';
|
import 'package:hub/pages/welcome_page/welcome_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/components/molecules/locals/data/repositories/locals_repository_impl.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
export 'package:go_router/go_router.dart';
|
export 'package:go_router/go_router.dart';
|
||||||
|
@ -40,7 +42,7 @@ export 'serialization_util.dart';
|
||||||
|
|
||||||
const kTransitionInfoKey = '__transition_info__';
|
const kTransitionInfoKey = '__transition_info__';
|
||||||
|
|
||||||
final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
class AppStateNotifier extends ChangeNotifier {
|
class AppStateNotifier extends ChangeNotifier {
|
||||||
AppStateNotifier._();
|
AppStateNotifier._();
|
||||||
|
@ -58,7 +60,7 @@ class AppStateNotifier extends ChangeNotifier {
|
||||||
|
|
||||||
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
navigatorKey: key,
|
navigatorKey: navigatorKey,
|
||||||
initialLocation: '/',
|
initialLocation: '/',
|
||||||
debugLogDiagnostics: true,
|
debugLogDiagnostics: true,
|
||||||
redirect: (context, state) {
|
redirect: (context, state) {
|
||||||
|
@ -84,28 +86,13 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
return FutureBuilder<Widget>(
|
return FutureBuilder<Widget>(
|
||||||
future: () async {
|
future: () async {
|
||||||
final bool isLogged = await StorageHelper().get(
|
final bool isLogged = await StorageHelper().get(SecureStorageKey.isLogged.value) == 'true';
|
||||||
SecureStorageKey.isLogged.value, Storage.SecureStorage) ==
|
final bool haveLocal = await StorageHelper().get(SecureStorageKey.haveLocal.value) == 'true';
|
||||||
'true';
|
final bool haveUserUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value))?.isNotEmpty ?? false;
|
||||||
final bool haveLocal = await StorageHelper().get(
|
final bool haveDevUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value))?.isNotEmpty ?? false;
|
||||||
SecureStorageKey.haveLocal.value,
|
|
||||||
Storage.SecureStorage) ==
|
|
||||||
'true';
|
|
||||||
final bool haveUserUUID = (await StorageHelper().get(
|
|
||||||
SQLiteStorageKey.userUUID.value,
|
|
||||||
Storage.SQLiteStorage))
|
|
||||||
?.isNotEmpty ??
|
|
||||||
false;
|
|
||||||
final bool haveDevUUID = (await StorageHelper().get(
|
|
||||||
SQLiteStorageKey.devUUID.value,
|
|
||||||
Storage.SQLiteStorage))
|
|
||||||
?.isNotEmpty ??
|
|
||||||
false;
|
|
||||||
|
|
||||||
if (isLogged && haveDevUUID && haveUserUUID) {
|
if (isLogged && haveDevUUID && haveUserUUID) {
|
||||||
return haveLocal
|
return haveLocal ? HomePageWidget(LocalsRepositoryImpl().update) : const ReceptionPageWidget();
|
||||||
? const HomePageWidget()
|
|
||||||
: const ReceptionPageWidget();
|
|
||||||
} else {
|
} else {
|
||||||
return const WelcomePageWidget();
|
return const WelcomePageWidget();
|
||||||
}
|
}
|
||||||
|
@ -126,62 +113,40 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'forgotPassword',
|
name: 'forgotPassword',
|
||||||
path: '/forgotPassword',
|
path: '/forgotPassword',
|
||||||
builder: (context, params) => ForgotPasswordScreen(
|
builder: (context, params) {
|
||||||
|
late final String email = params.getParam('email', ParamType.String);
|
||||||
|
late final String token = params.getParam('token', ParamType.String);
|
||||||
|
|
||||||
|
return ForgotPasswordScreen(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
email: params.getParam('email', ParamType.String),
|
email: email,
|
||||||
token: params.getParam('token', ParamType.String))),
|
token: token,
|
||||||
FFRoute(name: 'homePage', path: '/homePage', builder: (context, params) => HomePageWidget(key: UniqueKey())),
|
);
|
||||||
FFRoute(
|
}),
|
||||||
name: 'petsOnThePropertyPage',
|
FFRoute(name: 'homePage', path: '/homePage', builder: (context, params) {
|
||||||
path: '/petsOnThePropertyPage',
|
final Future<bool> Function(BuildContext context)? update = params.getParam('update', ParamType.Function);
|
||||||
builder: (context, params) => Scaffold(body: const PetsHistoryScreen(isApp: true))),
|
return HomePageWidget(key: UniqueKey(), update);
|
||||||
FFRoute(
|
|
||||||
name: 'vehiclesOnThePropertyPage',
|
}),
|
||||||
path: '/vehiclesOnThePropertyPage',
|
FFRoute(name: 'petsOnThePropertyPage', path: '/petsOnThePropertyPage', builder: (context, params) => Scaffold(body: const PetsHistoryScreen(isApp: true))),
|
||||||
builder: (context, params) => const VehicleOnTheProperty()),
|
FFRoute(name: 'vehiclesOnThePropertyPage', path: '/vehiclesOnThePropertyPage', builder: (context, params) => const VehicleOnTheProperty()),
|
||||||
FFRoute(
|
|
||||||
name: 'visitsOnThePropertyPage',
|
|
||||||
path: '/visitsOnThePropertyPage',
|
|
||||||
builder: (context, params) => const VisitsOnTheProperty()),
|
|
||||||
FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()),
|
FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()),
|
||||||
FFRoute(
|
FFRoute(name: 'messageHistoryPage', path: '/messageHistoryPage', builder: (context, params) => const MessageHistoryPageWidget()),
|
||||||
name: 'messageHistoryPage',
|
FFRoute(name: 'registerVisitorPage', path: '/registerVisitorPage', builder: (context, params) => const RegisterVisitorPageWidget()),
|
||||||
path: '/messageHistoryPage',
|
FFRoute(name: 'scheduleCompleteVisitPage', path: '/scheduleCompleteVisitPage', builder: (context, params) => const ScheduleCompleteVisitPageWidget()),
|
||||||
builder: (context, params) => const MessageHistoryPageWidget()),
|
FFRoute(name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()),
|
||||||
FFRoute(
|
FFRoute(name: 'provisionalSchedule', path: '/provisionalSchedule', builder: (context, params) => const ProvisionalSchedule()),
|
||||||
name: 'registerVisitorPage',
|
FFRoute(name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => /*const*/ FastPassPageWidget()),
|
||||||
path: '/registerVisitorPage',
|
FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => PreferencesPageWidget()),
|
||||||
builder: (context, params) => const RegisterVisitorPageWidget()),
|
|
||||||
FFRoute(
|
|
||||||
name: 'scheduleCompleteVisitPage',
|
|
||||||
path: '/scheduleCompleteVisitPage',
|
|
||||||
builder: (context, params) => const ScheduleCompleteVisitPageWidget()),
|
|
||||||
FFRoute(
|
|
||||||
name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()),
|
|
||||||
FFRoute(
|
|
||||||
name: 'provisionalSchedule',
|
|
||||||
path: '/provisionalSchedule',
|
|
||||||
builder: (context, params) => const ProvisionalSchedule()),
|
|
||||||
FFRoute(
|
|
||||||
name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => /*const*/ FastPassPageWidget()),
|
|
||||||
FFRoute(
|
|
||||||
name: 'preferencesSettings',
|
|
||||||
path: '/preferencesSettings',
|
|
||||||
builder: (context, params) => PreferencesPageWidget()),
|
|
||||||
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()),
|
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()),
|
||||||
FFRoute(
|
FFRoute(name: 'residentsOnThePropertyPage', path: '/residentsOnThePropertyPage', builder: (context, params) => ResidentsOnTheProperty()),
|
||||||
name: 'peopleOnThePropertyPage',
|
FFRoute(name: 'visitsOnThePropertyPage', path: '/visitsOnThePropertyPage', builder: (context, params) => VisitsOnTheProperty()),
|
||||||
path: '/peopleOnThePropertyPage',
|
FFRoute(name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => PeopleOnThePropertyPage()),
|
||||||
builder: (context, params) => PeopleOnThePropertyPage()),
|
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'acessHistoryPage',
|
name: 'acessHistoryPage',
|
||||||
path: '/acessHistoryPage',
|
path: '/acessHistoryPage',
|
||||||
builder: (context, params) =>
|
builder: (context, params) => AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})),
|
||||||
AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})),
|
FFRoute(name: 'liberationHistory', path: '/liberationHistory', builder: (context, params) => const LiberationHistoryWidget()),
|
||||||
FFRoute(
|
|
||||||
name: 'liberationHistory',
|
|
||||||
path: '/liberationHistory',
|
|
||||||
builder: (context, params) => const LiberationHistoryWidget()),
|
|
||||||
FFRoute(name: 'signInPage', path: '/signInPage', builder: (context, params) => const SignInPageWidget()),
|
FFRoute(name: 'signInPage', path: '/signInPage', builder: (context, params) => const SignInPageWidget()),
|
||||||
FFRoute(name: 'signUpPage', path: '/signUpPage', builder: (context, params) => const SignUpPageWidget()),
|
FFRoute(name: 'signUpPage', path: '/signUpPage', builder: (context, params) => const SignUpPageWidget()),
|
||||||
FFRoute(name: 'welcomePage', path: '/welcomePage', builder: (context, params) => const WelcomePageWidget()),
|
FFRoute(name: 'welcomePage', path: '/welcomePage', builder: (context, params) => const WelcomePageWidget()),
|
||||||
|
@ -204,9 +169,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
|
|
||||||
extension NavParamExtensions on Map<String, String?> {
|
extension NavParamExtensions on Map<String, String?> {
|
||||||
Map<String, String> get withoutNulls => Map.fromEntries(
|
Map<String, String> get withoutNulls => Map.fromEntries(
|
||||||
entries
|
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value!)),
|
||||||
.where((e) => e.value != null)
|
|
||||||
.map((e) => MapEntry(e.key, e.value!)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,23 +183,18 @@ extension NavigationExtensions on BuildContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension _GoRouterStateExtensions on GoRouterState {
|
extension _GoRouterStateExtensions on GoRouterState {
|
||||||
Map<String, dynamic> get extraMap =>
|
Map<String, dynamic> get extraMap => extra != null ? extra as Map<String, dynamic> : {};
|
||||||
extra != null ? extra as Map<String, dynamic> : {};
|
|
||||||
Map<String, dynamic> get allParams => <String, dynamic>{}
|
Map<String, dynamic> get allParams => <String, dynamic>{}
|
||||||
..addAll(pathParameters)
|
..addAll(pathParameters)
|
||||||
..addAll(uri.queryParameters)
|
..addAll(uri.queryParameters)
|
||||||
..addAll(extraMap);
|
..addAll(extraMap);
|
||||||
TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey)
|
TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey) ? extraMap[kTransitionInfoKey] as TransitionInfo : TransitionInfo.appDefault();
|
||||||
? extraMap[kTransitionInfoKey] as TransitionInfo
|
|
||||||
: TransitionInfo.appDefault();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension GoRouterLocationExtension on GoRouter {
|
extension GoRouterLocationExtension on GoRouter {
|
||||||
String getCurrentLocation() {
|
String getCurrentLocation() {
|
||||||
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
|
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
|
||||||
final RouteMatchList matchList = lastMatch is ImperativeRouteMatch
|
final RouteMatchList matchList = lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration;
|
||||||
? lastMatch.matches
|
|
||||||
: routerDelegate.currentConfiguration;
|
|
||||||
return matchList.uri.toString();
|
return matchList.uri.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,18 +206,13 @@ class FFParameters {
|
||||||
final Map<String, Future<dynamic> Function(String)> asyncParams;
|
final Map<String, Future<dynamic> Function(String)> asyncParams;
|
||||||
Map<String, dynamic> futureParamValues = {};
|
Map<String, dynamic> futureParamValues = {};
|
||||||
|
|
||||||
bool get isEmpty =>
|
bool get isEmpty => state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey));
|
||||||
state.allParams.isEmpty ||
|
bool isAsyncParam(MapEntry<String, dynamic> param) => asyncParams.containsKey(param.key) && param.value is String;
|
||||||
(state.allParams.length == 1 &&
|
|
||||||
state.extraMap.containsKey(kTransitionInfoKey));
|
|
||||||
bool isAsyncParam(MapEntry<String, dynamic> param) =>
|
|
||||||
asyncParams.containsKey(param.key) && param.value is String;
|
|
||||||
bool get hasFutures => state.allParams.entries.any(isAsyncParam);
|
bool get hasFutures => state.allParams.entries.any(isAsyncParam);
|
||||||
Future<bool> completeFutures() => Future.wait(
|
Future<bool> completeFutures() => Future.wait(
|
||||||
state.allParams.entries.where(isAsyncParam).map(
|
state.allParams.entries.where(isAsyncParam).map(
|
||||||
(param) async {
|
(param) async {
|
||||||
final doc = await asyncParams[param.key]!(param.value)
|
final doc = await asyncParams[param.key]!(param.value).onError((_, __) => null);
|
||||||
.onError((_, __) => null);
|
|
||||||
if (doc != null) {
|
if (doc != null) {
|
||||||
futureParamValues[param.key] = doc;
|
futureParamValues[param.key] = doc;
|
||||||
return true;
|
return true;
|
||||||
|
@ -314,9 +267,7 @@ class FFRoute {
|
||||||
key: state.pageKey,
|
key: state.pageKey,
|
||||||
child: child,
|
child: child,
|
||||||
transitionDuration: transitionInfo.duration,
|
transitionDuration: transitionInfo.duration,
|
||||||
transitionsBuilder:
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => PageTransition(
|
||||||
(context, animation, secondaryAnimation, child) =>
|
|
||||||
PageTransition(
|
|
||||||
type: transitionInfo.transitionType,
|
type: transitionInfo.transitionType,
|
||||||
duration: transitionInfo.duration,
|
duration: transitionInfo.duration,
|
||||||
reverseDuration: transitionInfo.duration,
|
reverseDuration: transitionInfo.duration,
|
||||||
|
@ -343,8 +294,7 @@ class TransitionInfo {
|
||||||
final Duration duration;
|
final Duration duration;
|
||||||
final Alignment? alignment;
|
final Alignment? alignment;
|
||||||
|
|
||||||
static TransitionInfo appDefault() =>
|
static TransitionInfo appDefault() => const TransitionInfo(hasTransition: false);
|
||||||
const TransitionInfo(hasTransition: false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class RootPageContext {
|
class RootPageContext {
|
||||||
|
@ -356,11 +306,8 @@ class RootPageContext {
|
||||||
final rootPageContext = context.read<RootPageContext?>();
|
final rootPageContext = context.read<RootPageContext?>();
|
||||||
final isRootPage = rootPageContext?.isRootPage ?? false;
|
final isRootPage = rootPageContext?.isRootPage ?? false;
|
||||||
final location = GoRouterState.of(context).uri.toString();
|
final location = GoRouterState.of(context).uri.toString();
|
||||||
return isRootPage &&
|
return isRootPage && location != '/' && location != rootPageContext?.errorRoute;
|
||||||
location != '/' &&
|
|
||||||
location != rootPageContext?.errorRoute;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Widget wrap(Widget child, {String? errorRoute}) =>
|
static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(value: RootPageContext(true, errorRoute), child: child);
|
||||||
Provider.value(value: RootPageContext(true, errorRoute), child: child);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ enum ParamType {
|
||||||
FFPlace,
|
FFPlace,
|
||||||
FFUploadedFile,
|
FFUploadedFile,
|
||||||
JSON,
|
JSON,
|
||||||
|
Function,
|
||||||
DataStruct,
|
DataStruct,
|
||||||
Enum,
|
Enum,
|
||||||
}
|
}
|
||||||
|
@ -186,6 +186,8 @@ dynamic deserializeParam<T>(
|
||||||
switch (paramType) {
|
switch (paramType) {
|
||||||
case ParamType.int:
|
case ParamType.int:
|
||||||
return int.tryParse(param);
|
return int.tryParse(param);
|
||||||
|
case ParamType.Function:
|
||||||
|
return param;
|
||||||
case ParamType.double:
|
case ParamType.double:
|
||||||
return double.tryParse(param);
|
return double.tryParse(param);
|
||||||
case ParamType.String:
|
case ParamType.String:
|
||||||
|
|
|
@ -1,12 +1 @@
|
||||||
export 'pages/acess_history_page/acess_history_page_widget.dart' show AccessHistoryScreen;
|
|
||||||
export 'pages/home_page/home_page_widget.dart' show HomePageWidget;
|
|
||||||
export 'pages/liberation_history/liberation_history_widget.dart' show LiberationHistoryWidget;
|
|
||||||
export 'pages/people_on_the_property_page/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget;
|
|
||||||
export 'pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget;
|
|
||||||
export 'pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget;
|
|
||||||
export 'pages/register_visitor_page/register_visitor_page_widget.dart' show RegisterVisitorPageWidget;
|
|
||||||
export 'pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'
|
|
||||||
show ScheduleCompleteVisitPageWidget;
|
|
||||||
export 'pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget;
|
|
||||||
export 'pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget;
|
|
||||||
export 'pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget;
|
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
|
||||||
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||||
|
import 'package:hub/backend/notifications/notification_service.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
|
Future<void> initializeApp() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await _initializeTracking();
|
||||||
|
await StorageHelper().init();
|
||||||
|
|
||||||
|
await _initializeFirebase();
|
||||||
|
await _initializeNotificationService();
|
||||||
|
_initializeUrlStrategy();
|
||||||
|
_initializeSystemSettings();
|
||||||
|
await _initializeFlutterFlow();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initializeTracking() async {
|
||||||
|
await AppTrackingTransparency.requestTrackingAuthorization();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initializeFirebase() async {
|
||||||
|
await Firebase.initializeApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initializeNotificationService() async {
|
||||||
|
await NotificationService.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _initializeUrlStrategy() {
|
||||||
|
setUrlStrategy(PathUrlStrategy());
|
||||||
|
}
|
||||||
|
|
||||||
|
void _initializeSystemSettings() {
|
||||||
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
|
if (kDebugMode) {
|
||||||
|
log("Aplicativo em Debug Mode, crashlytics desabilitado!");
|
||||||
|
} else {
|
||||||
|
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
||||||
|
if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
|
||||||
|
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initializeFlutterFlow() async {
|
||||||
|
await FlutterFlowTheme.initialize();
|
||||||
|
await FFLocalizations.initialize();
|
||||||
|
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||||
|
usePathUrlStrategy();
|
||||||
|
}
|
126
lib/main.dart
126
lib/main.dart
|
@ -2,103 +2,51 @@ import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
|
||||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_web_plugins/url_strategy.dart';
|
|
||||||
import 'package:hub/backend/notifications/notification_service.dart';
|
import 'package:hub/backend/notifications/notification_service.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/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/base_storage.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/deeplink/deep_link_service.dart';
|
import 'package:hub/shared/services/deeplink/deep_link_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
|
|
||||||
import 'package:responsive_framework/responsive_framework.dart';
|
import 'package:responsive_framework/responsive_framework.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:hub/shared/extensions/string_extensions.dart';
|
||||||
|
|
||||||
import 'backend/notifications/firebase_messaging_service.dart';
|
import 'backend/notifications/firebase_messaging_service.dart';
|
||||||
|
import 'features/home/index.dart';
|
||||||
|
import 'initialization.dart';
|
||||||
|
import 'shared/components/molecules/menu/index.dart';
|
||||||
|
import 'shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
await initializeApp();
|
await initializeApp();
|
||||||
runApp(const App());
|
runApp(const ProviderScope(child: App()));
|
||||||
FirebaseMessaging.onBackgroundMessage(_backgroundHandlerMessage);
|
FirebaseMessaging.onBackgroundMessage(_backgroundHandlerMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
await _initializeTracking();
|
|
||||||
await StorageHelper().init();
|
|
||||||
|
|
||||||
await _initializeFirebase();
|
|
||||||
await _initializeNotificationService();
|
|
||||||
_initializeUrlStrategy();
|
|
||||||
_initializeSystemSettings();
|
|
||||||
await _initializeFlutterFlow();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _initializeTracking() async {
|
|
||||||
await AppTrackingTransparency.requestTrackingAuthorization();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _initializeFirebase() async {
|
|
||||||
await Firebase.initializeApp();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _initializeNotificationService() async {
|
|
||||||
await NotificationService.initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _initializeUrlStrategy() {
|
|
||||||
setUrlStrategy(PathUrlStrategy());
|
|
||||||
}
|
|
||||||
|
|
||||||
void _initializeSystemSettings() {
|
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
||||||
if (kDebugMode) {
|
|
||||||
log("Aplicativo em Debug Mode, crashlytics desabilitado!");
|
|
||||||
} else {
|
|
||||||
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
|
||||||
if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
|
|
||||||
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _initializeFlutterFlow() async {
|
|
||||||
await FlutterFlowTheme.initialize();
|
|
||||||
await FFLocalizations.initialize();
|
|
||||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
|
||||||
usePathUrlStrategy();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper()
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
|
||||||
StorageHelper().context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Platform.isIOS) {
|
if (!Platform.isIOS) {
|
||||||
NotificationService.show(
|
NotificationService.show(title: message.notification!.title!, body: message.notification!.body!, payload: Map<String, String>.from(message.data));
|
||||||
title: message.notification!.title!,
|
|
||||||
body: message.notification!.body!,
|
|
||||||
payload: Map<String, String>.from(message.data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _backgroundHandlerMessage(RemoteMessage message) async {
|
Future<void> _backgroundHandlerMessage(RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper()
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
.set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
|
||||||
StorageHelper().context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,11 +57,10 @@ class App extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
State<App> createState() => _AppState();
|
State<App> createState() => _AppState();
|
||||||
|
|
||||||
static _AppState of(BuildContext context) =>
|
static _AppState of(BuildContext context) => context.findAncestorStateOfType<_AppState>()!;
|
||||||
context.findAncestorStateOfType<_AppState>()!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppState extends State<App> with WidgetsBindingObserver {
|
class _AppState extends State<App> {
|
||||||
Locale? _locale = FFLocalizations.getStoredLocale();
|
Locale? _locale = FFLocalizations.getStoredLocale();
|
||||||
ThemeMode _themeMode = FlutterFlowTheme.themeMode;
|
ThemeMode _themeMode = FlutterFlowTheme.themeMode;
|
||||||
late AppStateNotifier _appStateNotifier;
|
late AppStateNotifier _appStateNotifier;
|
||||||
|
@ -152,8 +99,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates =
|
final Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates = const [
|
||||||
const [
|
|
||||||
FFLocalizationsDelegate(),
|
FFLocalizationsDelegate(),
|
||||||
GlobalMaterialLocalizations.delegate,
|
GlobalMaterialLocalizations.delegate,
|
||||||
GlobalWidgetsLocalizations.delegate,
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
@ -192,19 +138,16 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
FirebaseMessaging.onMessage.listen(_foregroundHandlerMessage);
|
FirebaseMessaging.onMessage.listen(_foregroundHandlerMessage);
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper().set(
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
|
||||||
log('onMessageOpenedApp');
|
log('onMessageOpenedApp');
|
||||||
} else {
|
} else {
|
||||||
onMessageReceived(message.data, message.notification!.body,
|
onMessageReceived(message.data, message.notification!.body, message.data['click_action']);
|
||||||
message.data['click_action']);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
FirebaseMessaging.instance.getInitialMessage().then((message) async {
|
FirebaseMessaging.instance.getInitialMessage().then((message) async {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
if (message.data['click_action'] == 'enroll_cond') {
|
if (message.data['click_action'] == 'enroll_cond') {
|
||||||
await StorageHelper().set(
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
|
||||||
log('getInitialMessage');
|
log('getInitialMessage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,7 +169,6 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
|
||||||
|
|
||||||
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
||||||
_appStateNotifier = AppStateNotifier.instance;
|
_appStateNotifier = AppStateNotifier.instance;
|
||||||
|
@ -242,21 +184,29 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
|
||||||
if (state == AppLifecycleState.detached) {
|
|
||||||
await LocalizationService.processLocals(context);
|
|
||||||
FirebaseMessagingService().updateDeviceToken();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp.router(
|
return MultiBlocProvider(
|
||||||
|
providers: [
|
||||||
|
BlocProvider(
|
||||||
|
create: (context) => MenuBloc(
|
||||||
|
style: MenuView.list_grid,
|
||||||
|
item: EnumMenuItem.button,
|
||||||
|
entries: MenuEntry.getEntriesByType(MenuEntryType.Home),
|
||||||
|
)..add(MenuEvent()),
|
||||||
|
),
|
||||||
|
BlocProvider<HomeBloc>(
|
||||||
|
create: (context) => HomeBloc()..add(HomeEvent()),
|
||||||
|
),
|
||||||
|
BlocProvider(
|
||||||
|
create: (context) => LocalProfileBloc()..add(LocalProfileEvent()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
child: MaterialApp.router(
|
||||||
key: navigatorKey,
|
key: navigatorKey,
|
||||||
title: 'FRE ACCESS HUB',
|
title: 'FRE ACCESS HUB',
|
||||||
builder: builder,
|
builder: builder,
|
||||||
|
@ -267,6 +217,8 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
darkTheme: _darkTheme,
|
darkTheme: _darkTheme,
|
||||||
themeMode: _themeMode,
|
themeMode: _themeMode,
|
||||||
routerConfig: _router,
|
routerConfig: _router,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
|
|
||||||
import 'package:hub/pages/about_property_page/about_property_screen.dart';
|
|
||||||
|
|
||||||
class AboutPropertyModel extends FlutterFlowModel<AboutPropertyPage> {
|
|
||||||
dynamic item;
|
|
||||||
|
|
||||||
VoidCallback? safeSetState;
|
|
||||||
|
|
||||||
late MenuComponentModel menuComponentModel;
|
|
||||||
|
|
||||||
Future<void> initAsync() async {
|
|
||||||
safeSetState?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {
|
|
||||||
menuComponentModel = createModel(
|
|
||||||
context,
|
|
||||||
() => MenuComponentModel(expandable: true, style: MenuView.list_grid, item: MenuItem.button, menuOptions: [
|
|
||||||
MenuOption.PetsOnTheProperty,
|
|
||||||
MenuOption.ResidentsOnTheProperty,
|
|
||||||
MenuOption.VisitsOnTheProperty,
|
|
||||||
MenuOption.VehiclesOnTheProperty,
|
|
||||||
MenuOption.PackagesOnTheProperty,
|
|
||||||
]));
|
|
||||||
|
|
||||||
initAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -4,8 +4,8 @@ import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -33,9 +33,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -7,8 +7,8 @@ import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
import 'package:flutter_inappwebview/flutter_inappwebview.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/base_storage.dart' as hub;
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/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';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
@ -25,11 +25,11 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
late InAppWebViewController _controllerIOS;
|
late InAppWebViewController _controllerIOS;
|
||||||
|
|
||||||
Future<Map<String, String>> initVariables() async {
|
Future<Map<String, String>> initVariables() async {
|
||||||
final email = await StorageHelper().get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage) ?? '';
|
final email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||||
final name = await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage) ?? '';
|
final name = (await StorageHelper().get(KeychainStorageKey.userName.value)) ?? '';
|
||||||
final devUUID = await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage) ?? '';
|
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage) ?? '';
|
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final cliUUID = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? '';
|
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
const createdAt = '0000-00-00 00:00:00';
|
const createdAt = '0000-00-00 00:00:00';
|
||||||
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
|
||||||
final freUserData =
|
final freUserData =
|
||||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.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/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
import '../../flutter_flow/flutter_flow_animations.dart';
|
import '../../flutter_flow/flutter_flow_animations.dart';
|
||||||
import '../../flutter_flow/flutter_flow_icon_button.dart';
|
import '../../flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_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/pages/home_page/home_page_widget.dart';
|
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
|
|
||||||
class HomePageModel extends FlutterFlowModel<HomePageWidget> {
|
|
||||||
HomePageModel({required this.safeSetState});
|
|
||||||
late final VoidCallback safeSetState;
|
|
||||||
|
|
||||||
bool isGrid = false;
|
|
||||||
late final String devUUID;
|
|
||||||
late final String cliUUID;
|
|
||||||
late final String userUUID;
|
|
||||||
late final String userName;
|
|
||||||
late final String userEmail;
|
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
|
||||||
FocusNode? textFieldFocusNode;
|
|
||||||
TextEditingController? textController;
|
|
||||||
String? Function(BuildContext, String?)? textControllerValidator;
|
|
||||||
late LocalProfileComponentModel localComponentModel;
|
|
||||||
late MenuComponentModel homeMenuComponentModel;
|
|
||||||
late MenuComponentModel drawerMenuComponentModel;
|
|
||||||
late MessageWellComponentModel messageWellComponentModel;
|
|
||||||
|
|
||||||
Future<void> _initVariable() async {
|
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
userName = (await StorageHelper().get(SQLiteStorageKey.userName.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
userEmail = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
|
||||||
safeSetState.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {
|
|
||||||
_initVariable();
|
|
||||||
localComponentModel = createModel(context, () => LocalProfileComponentModel());
|
|
||||||
homeMenuComponentModel = createModel(
|
|
||||||
context,
|
|
||||||
() => MenuComponentModel(expandable: true, style: MenuView.list_grid, item: MenuItem.button, menuOptions: [
|
|
||||||
MenuOption.SettingsOnTheApp,
|
|
||||||
MenuOption.MessagesOnTheProperty,
|
|
||||||
MenuOption.AccessOnTheProperty,
|
|
||||||
MenuOption.PetsRegister,
|
|
||||||
MenuOption.VisitorsRegister,
|
|
||||||
MenuOption.ReservationsOnTheLocal,
|
|
||||||
MenuOption.PackagesOnTheProperty,
|
|
||||||
MenuOption.DeliverySchedule,
|
|
||||||
MenuOption.WorkersOnTheProperty,
|
|
||||||
MenuOption.AboutProperty,
|
|
||||||
MenuOption.CompleteSchedule,
|
|
||||||
MenuOption.FastPassSchedule,
|
|
||||||
MenuOption.LiberationsOnTheProperty,
|
|
||||||
MenuOption.QRCodeAccessInProperty,
|
|
||||||
]));
|
|
||||||
drawerMenuComponentModel = createModel(
|
|
||||||
context,
|
|
||||||
() => MenuComponentModel(expandable: false, style: MenuView.list, item: MenuItem.tile, menuOptions: [
|
|
||||||
MenuOption.SettingsOnTheApp,
|
|
||||||
MenuOption.MessagesOnTheProperty,
|
|
||||||
MenuOption.AccessOnTheProperty,
|
|
||||||
MenuOption.PetsRegister,
|
|
||||||
MenuOption.VisitorsRegister,
|
|
||||||
MenuOption.ReservationsOnTheLocal,
|
|
||||||
MenuOption.PackagesOnTheProperty,
|
|
||||||
MenuOption.DeliverySchedule,
|
|
||||||
MenuOption.WorkersOnTheProperty,
|
|
||||||
MenuOption.AboutProperty,
|
|
||||||
MenuOption.CompleteSchedule,
|
|
||||||
MenuOption.FastPassSchedule,
|
|
||||||
MenuOption.LiberationsOnTheProperty,
|
|
||||||
MenuOption.QRCodeAccessInProperty,
|
|
||||||
MenuOption.LogoutOnTheApp,
|
|
||||||
]));
|
|
||||||
messageWellComponentModel = createModel(context, () => MessageWellComponentModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
unfocusNode.dispose();
|
|
||||||
textFieldFocusNode?.dispose();
|
|
||||||
textController?.dispose();
|
|
||||||
|
|
||||||
localComponentModel.dispose();
|
|
||||||
homeMenuComponentModel.dispose();
|
|
||||||
messageWellComponentModel.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,8 +3,8 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -36,9 +36,9 @@ class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future answersRequest(
|
Future answersRequest(
|
||||||
|
|
|
@ -3,8 +3,8 @@ import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget> {
|
class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -39,9 +39,9 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -9,8 +9,8 @@ import 'package:hub/components/templates_components/details_component/details_co
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
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/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -64,7 +64,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value) ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,27 +1,14 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart';
|
import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
|
||||||
|
|
||||||
class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyPage> {
|
class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyPage> {
|
||||||
PeopleOnThePropertyPageModel({this.onRefresh});
|
/// State fields for stateful widgets in this page.
|
||||||
late final VoidCallback? onRefresh;
|
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
late final String devUUID;
|
|
||||||
late final String cliUUID;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {
|
void initState(BuildContext context) {}
|
||||||
initVariables();
|
|
||||||
}
|
|
||||||
|
|
||||||
void initVariables() async {
|
|
||||||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
onRefresh?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
|
@ -1,135 +1,68 @@
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
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/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart';
|
import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import '../../shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
|
||||||
|
|
||||||
class PeopleOnThePropertyPage extends StatefulWidget {
|
class PeopleOnThePropertyPage extends StatefulWidget {
|
||||||
const PeopleOnThePropertyPage({super.key});
|
const PeopleOnThePropertyPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_PeopleOnThePropertyPageState createState() => _PeopleOnThePropertyPageState();
|
State<PeopleOnThePropertyPage> createState() => _PeopleOnThePropertyPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with TickerProviderStateMixin {
|
class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> {
|
||||||
late ScrollController _scrollController;
|
late PeopleOnThePropertyPageModel _model;
|
||||||
|
|
||||||
int _pageNumber = 1;
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
bool _hasData = false;
|
|
||||||
bool _loading = false;
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
late final PeopleOnThePropertyPageModel model;
|
|
||||||
|
|
||||||
late Future<void> _future;
|
|
||||||
List<dynamic> _wrap = [];
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
model = createModel(context, () => PeopleOnThePropertyPageModel(onRefresh: () => safeSetState(() {})));
|
_model = createModel(context, () => PeopleOnThePropertyPageModel());
|
||||||
_future = _fetchVisits();
|
|
||||||
|
|
||||||
_scrollController = ScrollController()
|
|
||||||
..addListener(() {
|
|
||||||
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) {
|
|
||||||
_loadMore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_scrollController.dispose();
|
_model.dispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: _appBar(context),
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
body: Column(
|
appBar: AppBar(
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Center(
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: "Nenhum morador encontrado!",
|
|
||||||
enText: "No residents found!",
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
fontSize: limitedHeaderTextSize,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else if (_hasData == true || _pageNumber >= 1)
|
|
||||||
Expanded(
|
|
||||||
child: FutureBuilder<void>(
|
|
||||||
future: _future,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
return ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: const BouncingScrollPhysics(),
|
|
||||||
controller: _scrollController,
|
|
||||||
itemCount: _wrap.length + 1,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (index == 0) {
|
|
||||||
// Add your item here
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
|
||||||
child: Text(
|
|
||||||
'',
|
|
||||||
textAlign: TextAlign.right,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
final item = _wrap[index - 1];
|
|
||||||
return _item(context, item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
if (_hasData == true && _loading == true)
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
|
||||||
child: Center(
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
].addToStart(const SizedBox(height: 0)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
PreferredSizeWidget _appBar(BuildContext context) {
|
|
||||||
return AppBar(
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(FFLocalizations.of(context).getVariableText(ptText: 'Moradores', enText: 'Residents'),
|
forceMaterialTransparency: true,
|
||||||
|
leading: FlutterFlowIconButton(
|
||||||
|
borderColor: Colors.transparent,
|
||||||
|
borderRadius: 30.0,
|
||||||
|
borderWidth: 1.0,
|
||||||
|
buttonSize: 60.0,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.keyboard_arrow_left,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'nsu13r5d' /* Pessoas na Propriedade */,
|
||||||
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
@ -137,114 +70,103 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
)),
|
),
|
||||||
leading: _backButton(context, FlutterFlowTheme.of(context)),
|
),
|
||||||
|
actions: const [],
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
actions: [],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
|
||||||
return FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 30.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 60.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_left,
|
|
||||||
color: theme.primaryText,
|
|
||||||
size: 30.0,
|
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
body: SafeArea(
|
||||||
);
|
top: true,
|
||||||
}
|
child: FutureBuilder<ApiCallResponse>(
|
||||||
|
future: PhpGroup.getPessoasLocalCall.call(),
|
||||||
Future<ApiCallResponse?> _fetchVisits() async {
|
builder: (context, snapshot) {
|
||||||
try {
|
// Customize what your widget looks like when it's loading.
|
||||||
setState(() => _loading = true);
|
if (!snapshot.hasData) {
|
||||||
|
return Center(
|
||||||
var response = await PhpGroup.getResidentsByProperty.call(_pageNumber.toString());
|
child: SizedBox(
|
||||||
|
width: 50.0,
|
||||||
final List<dynamic> residents = response.jsonBody['residents'] ?? [];
|
height: 50.0,
|
||||||
safeSetState(() => count = response.jsonBody['total_rows'] ?? 0);
|
child: SpinKitCircle(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
if (residents.isNotEmpty) {
|
size: 50.0,
|
||||||
setState(() {
|
|
||||||
_wrap.addAll(residents);
|
|
||||||
_hasData = true;
|
|
||||||
_loading = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
_showNoMoreDataSnackBar(context);
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
_hasData = false;
|
|
||||||
_loading = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
return null;
|
|
||||||
} catch (e, s) {
|
|
||||||
DialogUtil.errorDefault(context);
|
|
||||||
LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de moradores", e, s);
|
|
||||||
setState(() {
|
|
||||||
_hasData = false;
|
|
||||||
_loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _loadMore() {
|
|
||||||
if (_hasData == true) {
|
|
||||||
_pageNumber++;
|
|
||||||
|
|
||||||
_future = _fetchVisits();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showNoMoreDataSnackBar(BuildContext context) {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: "Não há mais dados.",
|
|
||||||
enText: "No more data.",
|
|
||||||
),
|
),
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _item(BuildContext context, dynamic uItem) {
|
if (snapshot.hasError || snapshot.data?.exception != null) {
|
||||||
return CardItemTemplateComponentWidget(
|
if (snapshot.error != null && snapshot.stackTrace != null) {
|
||||||
imagePath:
|
LogUtil.requestAPIFailed('getPessoasLocal.php', "", 'Busca Pessoas no Local', snapshot.error, snapshot.stackTrace!);
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['documento']}&tipo=Z',
|
}
|
||||||
labelsHashMap: {
|
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': uItem['nome'] ?? '',
|
return Center(
|
||||||
//statusweb
|
child: SizedBox(
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Possui App", enText: "Has App")}:':
|
width: double.infinity,
|
||||||
uItem['statusweb'] == "A"
|
height: 100,
|
||||||
? FFLocalizations.of(context).getVariableText(
|
child: Text(
|
||||||
ptText: 'Sim',
|
FFLocalizations.of(context).getVariableText(ptText: "Pessoas não encontradas", enText: "Persons not found"),
|
||||||
enText: 'Yes',
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final columnGetPessoasLocalResponse = snapshot.data!;
|
||||||
|
final getPoepleProperty = PhpGroup.getPessoasLocalCall
|
||||||
|
.pessoas(
|
||||||
|
columnGetPessoasLocalResponse.jsonBody,
|
||||||
)
|
)
|
||||||
: FFLocalizations.of(context).getVariableText(
|
?.toList() ??
|
||||||
ptText: 'Não',
|
[];
|
||||||
enText: 'No',
|
|
||||||
|
return ListView.builder(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: getPoepleProperty.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final getPoeplePropertyItem = getPoepleProperty[index];
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: Container(
|
||||||
|
width: 50.0,
|
||||||
|
height: 50.0,
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
fadeInDuration: const Duration(milliseconds: 500),
|
||||||
|
fadeOutDuration: const Duration(milliseconds: 500),
|
||||||
|
imageUrl:
|
||||||
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
getJsonField(
|
||||||
|
getPoeplePropertyItem,
|
||||||
|
r'''$.USU_NOME''',
|
||||||
|
).toString(),
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 40.0)),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
statusHashMap: [],
|
);
|
||||||
onTapCardItemAction: () async {},
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ 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/pets_page/pets_page_model.dart';
|
import 'package:hub/pages/pets_page/pets_page_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -58,7 +58,10 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
return AppBar(
|
return AppBar(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(FFLocalizations.of(context).getVariableText(enText: 'Pets', ptText: 'Pets'),
|
title: Text(FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Pets',
|
||||||
|
enText: 'Pets',
|
||||||
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
@ -291,10 +294,10 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
final devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||||
final userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
final cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
final cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
await showDialog(
|
await showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -12,8 +12,8 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/image_util.dart';
|
import 'package:hub/shared/utils/image_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
@ -116,10 +116,8 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
);
|
);
|
||||||
dropDownValueController1 = FormFieldController<String>(dropDownValue1 ??= defaultDropDownText);
|
dropDownValueController1 = FormFieldController<String>(dropDownValue1 ??= defaultDropDownText);
|
||||||
dropDownValueController2 = FormFieldController<String>(dropDownValue2 ??= defaultDropDownText);
|
dropDownValueController2 = FormFieldController<String>(dropDownValue2 ??= defaultDropDownText);
|
||||||
log('() => ): $devUUID');
|
|
||||||
|
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
log('() => ): $devUUID');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -149,15 +147,14 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
textControllerObservation = TextEditingController();
|
textControllerObservation = TextEditingController();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
devUUID = await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage) ?? '';
|
devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? '';
|
userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
|
cliUUID = await StorageHelper().get(KeychainStorageKey.clientUUID.value) ?? '';
|
||||||
petAmountRegister = await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage) ?? '';
|
petAmountRegister = await StorageHelper().get(KeychainStorageKey.petAmount.value) ?? '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void setEditForm() {
|
void setEditForm() {
|
||||||
log('item: $item');
|
|
||||||
|
|
||||||
if (item != null) petId = item['id'];
|
if (item != null) petId = item['id'];
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,10 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
|
|
||||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||||
return AppBarUtil(
|
return AppBarUtil(
|
||||||
title: 'Pets',
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Cadastrar Pets',
|
||||||
|
enText: 'Pets Register',
|
||||||
|
),
|
||||||
onBackButtonPressed: () => context.pop(),
|
onBackButtonPressed: () => context.pop(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.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/base_storage.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
import '../../shared/utils/snackbar_util.dart';
|
import '../../shared/utils/snackbar_util.dart';
|
||||||
|
@ -23,11 +23,11 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
late bool isPanic = false;
|
late bool isPanic = false;
|
||||||
|
|
||||||
Future<void> _initialize() async {
|
Future<void> _initialize() async {
|
||||||
isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
isFingerprint = await StorageHelper().get(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
isPerson = await StorageHelper().get(SQLiteStorageKey.person.value, Storage.SQLiteStorage) == 'true';
|
isPerson = await StorageHelper().get(KeychainStorageKey.person.value) == 'true';
|
||||||
isNotify = await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true';
|
isNotify = await StorageHelper().get(KeychainStorageKey.notify.value) == 'true';
|
||||||
isAccess = await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true';
|
isAccess = await StorageHelper().get(KeychainStorageKey.access.value) == 'true';
|
||||||
isPanic = await StorageHelper().get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true';
|
isPanic = await StorageHelper().get(KeychainStorageKey.panic.value) == 'true';
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,8 +36,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> enablePerson(BuildContext context) async {
|
Future<void> enablePerson(BuildContext context) async {
|
||||||
final String userDevUUID =
|
final String userDevUUID = (await StorageHelper().get(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -64,8 +63,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
.call(notifica: value)
|
.call(notifica: value)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
if (value.jsonBody['error'] == false) {
|
if (value.jsonBody['error'] == false) {
|
||||||
await StorageHelper()
|
await StorageHelper().set(KeychainStorageKey.notify.value, isNotify ? 'false' : 'true');
|
||||||
.set(SQLiteStorageKey.notify.value, isNotify ? 'false' : 'true', Storage.SQLiteStorage);
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Notification changed successfully',
|
enText: 'Notification changed successfully',
|
||||||
ptText: 'Notificação alterada com sucesso',
|
ptText: 'Notificação alterada com sucesso',
|
||||||
|
@ -81,15 +79,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catchError((e, s) {
|
.catchError((e, s) {
|
||||||
log('toggleNotify', error: e, stackTrace: s);
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Error changing notification',
|
enText: 'Error changing notification',
|
||||||
ptText: 'Erro ao alterar notificação',
|
ptText: 'Erro ao alterar notificação',
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async =>
|
.then((_) async => isNotify = await StorageHelper().get(KeychainStorageKey.notify.value) == 'true')
|
||||||
isNotify = await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
|
@ -138,14 +134,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> toggleAccess(BuildContext context) async {
|
Future<void> toggleAccess(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
await StorageHelper().set(SecureStorageKey.accessPass.value, key, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.accessPass.value, key);
|
||||||
await PhpGroup.changePass
|
await PhpGroup.changePass
|
||||||
.call(newSenha: key)
|
.call(newSenha: key)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
final String content;
|
final String content;
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
await StorageHelper()
|
await StorageHelper().set(KeychainStorageKey.access.value, isAccess ? 'false' : 'true');
|
||||||
.set(SQLiteStorageKey.access.value, isAccess ? 'false' : 'true', Storage.SQLiteStorage);
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Access pass changed successfully',
|
enText: 'Access pass changed successfully',
|
||||||
|
@ -167,8 +162,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async =>
|
.then((_) async => isAccess = await StorageHelper().get(KeychainStorageKey.access.value) == 'true')
|
||||||
isAccess = await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,14 +171,13 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
Future<void> togglePanic(BuildContext context) async {
|
Future<void> togglePanic(BuildContext context) async {
|
||||||
onChange(String key) async {
|
onChange(String key) async {
|
||||||
await StorageHelper().set(SecureStorageKey.panicPass.value, key, Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.panicPass.value, key);
|
||||||
await PhpGroup.changePanic
|
await PhpGroup.changePanic
|
||||||
.call(newSenhaPanico: key)
|
.call(newSenhaPanico: key)
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
final String content;
|
final String content;
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
await StorageHelper()
|
await StorageHelper().set(KeychainStorageKey.panic.value, isPanic ? 'false' : 'true');
|
||||||
.set(SQLiteStorageKey.panic.value, isPanic ? 'false' : 'true', Storage.SQLiteStorage);
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Panic password changed successfully',
|
enText: 'Panic password changed successfully',
|
||||||
|
@ -206,8 +199,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
})
|
})
|
||||||
.then((_) async =>
|
.then((_) async => isPanic = await StorageHelper().get(KeychainStorageKey.panic.value) == 'true')
|
||||||
isPanic = await StorageHelper().get(SQLiteStorageKey.panic.value, Storage.SQLiteStorage) == 'true')
|
|
||||||
.whenComplete(() => notifyListeners());
|
.whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,12 +214,11 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
onChange(String? key) async {
|
onChange(String? key) async {
|
||||||
isFingerprint = !isFingerprint;
|
isFingerprint = !isFingerprint;
|
||||||
await StorageHelper().set(SecureStorageKey.fingerprintPass.value, key ?? '', Storage.SecureStorage);
|
await StorageHelper().set(SecureStorageKey.fingerprintPass.value, key ?? '');
|
||||||
await StorageHelper()
|
await StorageHelper().set(KeychainStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false');
|
||||||
.set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage);
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
isFingerprint = await StorageHelper().get(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
isFingerprint ? onChange(null) : _showPassKey(context, onChange);
|
||||||
|
@ -270,7 +261,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
enText: 'Are you sure you want to unlink your device?',
|
enText: 'Are you sure you want to unlink your device?',
|
||||||
ptText: 'Tem certeza que deseja desvincular seu dispositivo?',
|
ptText: 'Tem certeza que deseja desvincular seu dispositivo?',
|
||||||
);
|
);
|
||||||
onConfirm() async => LocalizationService.unlinkLocal(context);
|
onConfirm() async => LocalsRepositoryImpl().unlinkLocal(context);
|
||||||
|
|
||||||
showAlertDialog(context, title, content, onConfirm);
|
showAlertDialog(context, title, content, onConfirm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import 'dart:typed_data';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart';
|
import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
|
||||||
class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
|
@ -29,8 +29,8 @@ class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initVariable() async {
|
Future<void> initVariable() async {
|
||||||
isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true';
|
isFingerprint = await StorageHelper().get(KeychainStorageKey.fingerprint.value) == 'true';
|
||||||
userDevUUID = await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage) ?? '';
|
userDevUUID = await StorageHelper().get(KeychainStorageKey.userDevUUID.value) ?? '';
|
||||||
safeSetState?.call();
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ 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/pages/qr_code_page/qr_code_page_model.dart';
|
import 'package:hub/pages/qr_code_page/qr_code_page_model.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
||||||
import 'package:hub/shared/utils/biometric_util.dart';
|
import 'package:hub/shared/utils/biometric_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
@ -353,7 +353,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
|
||||||
await BiometricHelper.checkBiometrics()
|
await BiometricHelper.checkBiometrics()
|
||||||
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
|
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
|
||||||
if (value == false) throw Exception('Biometric authentication failed');
|
if (value == false) throw Exception('Biometric authentication failed');
|
||||||
final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage);
|
final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value);
|
||||||
if (key == null || key.isEmpty) throw Exception('No key found');
|
if (key == null || key.isEmpty) throw Exception('No key found');
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/shared/helpers/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class ReceptionPageModel with ChangeNotifier {
|
class ReceptionPageModel with ChangeNotifier {
|
||||||
Future<void> getIdenfifier(BuildContext context) async {
|
Future<void> getIdenfifier(BuildContext context) async {
|
||||||
final String userDevUUID =
|
final String userDevUUID = (await StorageHelper().get(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||||
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
|
|
|
@ -10,9 +10,9 @@ 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/pages/reception_page/reception_page_model.dart';
|
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
||||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -30,11 +30,10 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
() async {
|
() async {
|
||||||
final lifecycle = await AwesomeNotifications().getAppLifeCycle();
|
final lifecycle = await AwesomeNotifications().getAppLifeCycle();
|
||||||
log('lifecycle: $lifecycle');
|
|
||||||
}();
|
}();
|
||||||
|
|
||||||
FirebaseMessagingService().updateDeviceToken();
|
FirebaseMessagingService().updateDeviceToken();
|
||||||
LocalizationService.checkLocals(context);
|
LocalsRepositoryImpl().validateLocal(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -45,10 +44,9 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
log('() => state: $state');
|
|
||||||
if (state == AppLifecycleState.resumed) {
|
if (state == AppLifecycleState.resumed) {
|
||||||
setState(() {
|
setState(() {
|
||||||
LocalizationService.checkLocals(context);
|
LocalsRepositoryImpl().validateLocal(context);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +73,8 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0),
|
padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context)
|
||||||
ptText: 'Falta pouco para você utilizar o FRE Access Hub...',
|
.getVariableText(ptText: 'Falta pouco para você utilizar o FRE Access Hub...', enText: 'You are close to using the FRE Access Hub...'),
|
||||||
enText: 'You are close to using the FRE Access Hub...'),
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: FlutterFlowTheme.of(context).displayLarge.override(
|
style: FlutterFlowTheme.of(context).displayLarge.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -94,8 +91,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40),
|
padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.',
|
||||||
'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.',
|
|
||||||
enText: 'Send your identifier to your condominium to link your account to our systems.'),
|
enText: 'Send your identifier to your condominium to link your account to our systems.'),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||||
|
@ -115,10 +111,8 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(60, 0, 60, 10),
|
padding: const EdgeInsets.fromLTRB(60, 0, 60, 10),
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: FFLocalizations.of(context).getVariableText(
|
message: FFLocalizations.of(context)
|
||||||
ptText:
|
.getVariableText(ptText: 'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.', enText: 'My Identifier'),
|
||||||
'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.',
|
|
||||||
enText: 'My Identifier'),
|
|
||||||
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
||||||
fontFamily: 'Nunito Sans',
|
fontFamily: 'Nunito Sans',
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
|
@ -129,8 +123,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
),
|
),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () => model.getIdenfifier(context),
|
onPressed: () => model.getIdenfifier(context),
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'),
|
||||||
.getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 30,
|
height: 30,
|
||||||
|
@ -164,8 +157,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
AuthenticationService.signOut(context);
|
AuthenticationService.signOut(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getVariableText(ptText: 'Sair da Conta', enText: 'Logout'),
|
||||||
.getVariableText(ptText: 'Sair da Conta', enText: 'Logout'),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 30,
|
height: 30,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue