diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index da96ae6b..87d8dd6f 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,6 +7,8 @@
+
+
Main
UIRequiresFullScreen
+ NSFaceIDUsageDescription
+ Why is my app authenticating using face id?
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
diff --git a/lib/app_state.dart b/lib/app_state.dart
index bfc93a71..0b79b097 100644
--- a/lib/app_state.dart
+++ b/lib/app_state.dart
@@ -1,9 +1,67 @@
+import 'dart:ffi';
+
+import 'package:f_r_e_hub/flutter_flow/permissions_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:csv/csv.dart';
+import 'package:local_auth/local_auth.dart';
+import 'package:permission_handler/permission_handler.dart';
import 'package:synchronized/synchronized.dart';
class FFAppState extends ChangeNotifier {
+ // Adiciona a variável para controle de autenticação biométrica
+ bool _isBiometricAuthenticated = false;
+ bool get isBiometricAuthenticated => _isBiometricAuthenticated;
+
+ // Instância do LocalAuthentication
+ final LocalAuthentication auth = LocalAuthentication();
+
+ // Verifica suporte biométrico
+ Future checkBiometrics() async {
+ try {
+ return await auth.canCheckBiometrics;
+ } catch (e) {
+ clearBiometricAuthentication();
+ debugPrint('Error checking biometrics: $e');
+ return false;
+ }
+ }
+
+ // Solicita autenticação biométrica
+ Future authenticateBiometric() async {
+ bool authenticated = false;
+ try {
+ authenticated = await auth.authenticate(
+ localizedReason: 'Scan your fingerprint to authenticate',
+ options: const AuthenticationOptions(
+ biometricOnly: true,
+ stickyAuth: true,
+ useErrorDialogs: true,
+ sensitiveTransaction: true,
+ )
+ );
+ if (authenticated) {
+ _isBiometricAuthenticated = true;
+ notifyListeners();
+ // Salvar o estado de autenticação biométrica, se necessário
+ }
+ } catch (e) {
+ print(e);
+ debugPrint('Error authenticating: $e');
+ clearBiometricAuthentication();
+ }
+ }
+
+ // Função para limpar o estado de autenticação biométrica
+ void clearBiometricAuthentication() {
+ _isBiometricAuthenticated = false;
+ notifyListeners();
+ // Limpar a informação salva, se necessário
+ }
+
+
+
+
static FFAppState _instance = FFAppState._internal();
factory FFAppState() {
@@ -69,6 +127,25 @@ class FFAppState extends ChangeNotifier {
await _safeInitAsync(() async {
_serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber;
});
+ await _safeInitAsync(() async {
+ _fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT;
+ });
+ await _safeInitAsync(() async {
+ _personOPT = await secureStorage.getBool('person') ?? _personOPT;
+ });
+ await _safeInitAsync(() async {
+ _passOPT = await secureStorage.getBool('pass') ?? _passOPT;
+ });
+ await _safeInitAsync(() async {
+ _notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT;
+ });
+ await _safeInitAsync(() async {
+ _accessPass = await secureStorage.getString('accessPass') ?? _accessPass;
+ });
+ await _safeInitAsync(() async {
+ _panicPass = await secureStorage.getString('panicPass') ?? _panicPass;
+ });
+
}
void update(VoidCallback callback) {
@@ -78,6 +155,70 @@ class FFAppState extends ChangeNotifier {
late FlutterSecureStorage secureStorage;
+ String _accessPass = '';
+ String get accessPass => _accessPass;
+ set accessPass(String value) {
+ _accessPass = value;
+ secureStorage.setString('accessPass', value);
+ }
+
+ void deleteAccessPass() {
+ secureStorage.delete(key: 'accessPass');
+ }
+
+ String _panicPass = '';
+ String get panicPass => _panicPass;
+ set panicPass(String value) {
+ _panicPass = value;
+ secureStorage.setString
+ ('panicPass', value);
+ }
+
+ void deletePanicPass() {
+ secureStorage.delete(key: 'panicPass');
+ }
+
+ bool _notifyOPT = false;
+ bool get notify => _notifyOPT;
+ set notify(bool value) {
+ _notifyOPT = value;
+ secureStorage.setBool('notify', value);
+ }
+
+ bool _passOPT = false;
+ bool get pass => _passOPT;
+ set pass(bool value) {
+ _passOPT =
+ value;
+ secureStorage.setBool('pass', value);
+ }
+
+ void deletePass() {
+ secureStorage.delete(key: 'pass');
+ }
+
+ bool _personOPT = false;
+ bool get person => _personOPT;
+ set person(bool value) {
+ _personOPT = value;
+ secureStorage.setBool('person', value);
+ }
+
+ void deletePerson() {
+ secureStorage.delete(key: 'person');
+ }
+
+ bool _fingerprintOPT = false;
+ bool get fingerprint => _fingerprintOPT;
+ set fingerprint(bool value) {
+ _fingerprintOPT = value;
+ secureStorage.setBool('fingerprint', value);
+ }
+
+ void deleteFingerprint() {
+ secureStorage.delete(key: 'fingerprint');
+ }
+
String _serialNumber = '';
String get serialNumber => _serialNumber;
set serialNumber(String value) {
@@ -270,6 +411,10 @@ class FFAppState extends ChangeNotifier {
void deleteName() {
secureStorage.delete(key: 'ff_name');
}
+
+ void deleteAll() {
+ secureStorage.deleteAll();
+ }
}
void _safeInit(Function() initializeField) {
diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart
index 0f820e03..3b8fe216 100644
--- a/lib/backend/api_requests/api_calls.dart
+++ b/lib/backend/api_requests/api_calls.dart
@@ -41,8 +41,125 @@ class PhpGroup {
static GetLiberationsCopyCall getLiberationsCopyCall =
GetLiberationsCopyCall();
static GetMessagesCall getMessagesCall = GetMessagesCall();
+ static ChangeNotifica changeNotifica = ChangeNotifica();
+ static RespondeVinculo resopndeVinculo = RespondeVinculo();
+ static ChangePass changePass = ChangePass();
}
+class ChangePass {
+ Future call({
+ String? devUUID = '',
+ String? userUUID = '',
+ String? cliID = '',
+ String? atividade = '',
+ String? newSenha = '',
+ }) async {
+ final baseUrl = PhpGroup.getBaseUrl();
+
+ return ApiManager.instance.makeApiCall(
+ callName: 'changePass',
+ apiUrl: '$baseUrl/processRequest.php',
+ callType: ApiCallType.POST,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {
+ 'devUUID': devUUID,
+ 'userUUID': userUUID,
+ 'cliID': cliID,
+ 'atividade': atividade,
+ 'newSenha': newSenha,
+ },
+ bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
+ returnBody: true,
+ encodeBodyUtf8: false,
+ decodeUtf8: false,
+ cache: false,
+ isStreamingApi: false,
+ alwaysAllowBody: false,
+ );
+ }
+
+ bool? error(dynamic response) => castToType(getJsonField(
+ response,
+ r'''$.error''',
+ ));
+}
+
+class RespondeVinculo {
+ Future call({
+ String? devUUID = '',
+ String? userUUID = '',
+ String? cliID = '',
+ String? tarefa = '',
+ }) async {
+ final baseUrl = PhpGroup.getBaseUrl();
+
+ return ApiManager.instance.makeApiCall(
+ callName: 'respondeVinculo',
+ apiUrl: '$baseUrl/processRequest.php',
+ callType: ApiCallType.POST,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {
+ 'devUUID': devUUID,
+ 'userUUID': userUUID,
+ 'cliID': cliID,
+ 'tarefa': tarefa,
+ },
+ bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
+ returnBody: true,
+ encodeBodyUtf8: false,
+ decodeUtf8: false,
+ cache: false,
+ isStreamingApi: false,
+ alwaysAllowBody: false,
+ );
+ }
+
+}
+
+class ChangeNotifica {
+ Future call({
+ String? devUUID = '',
+ String? userUUID = '',
+ String? cliID = '',
+ String? atividade = '',
+ String? notifica = '',
+ }) async {
+ final baseUrl = PhpGroup.getBaseUrl();
+
+ return ApiManager.instance.makeApiCall(
+ callName: 'changeNotifica',
+ apiUrl: '$baseUrl/processRequest.php',
+ callType: ApiCallType.POST,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {
+ 'devUUID': devUUID,
+ 'userUUID': userUUID,
+ 'cliID': cliID,
+ 'atividade': atividade,
+ 'notifica': notifica,
+ },
+ bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
+ returnBody: true,
+ encodeBodyUtf8: false,
+ decodeUtf8: false,
+ cache: false,
+ isStreamingApi: false,
+ alwaysAllowBody: false,
+ );
+ }
+
+ bool? error(dynamic response) => castToType(getJsonField(
+ response,
+ r'''$.error''',
+ ));
+}
+
class UpdToken {
Future call({
String? token = '',
diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart
new file mode 100644
index 00000000..51674c2a
--- /dev/null
+++ b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart
@@ -0,0 +1,31 @@
+import '/flutter_flow/flutter_flow_util.dart';
+import '/flutter_flow/form_field_controller.dart';
+import 'opt_modal_widget.dart' show OptModalWidget;
+import 'package:flutter/material.dart';
+
+class OptModalModel extends FlutterFlowModel {
+ /// State fields for stateful widgets in this component.
+
+ // State field(s) for TextField widget.
+ FocusNode? textFieldFocusNode;
+ TextEditingController? textController;
+ String? Function(BuildContext, String?)? textControllerValidator;
+ // State field(s) for Checkbox widget.
+ bool? checkboxValue1;
+ // State field(s) for Checkbox widget.
+ bool? checkboxValue2;
+ // State field(s) for CheckboxGroup widget.
+ FormFieldController>? checkboxGroupValueController;
+ List? get checkboxGroupValues => checkboxGroupValueController?.value;
+ set checkboxGroupValues(List? v) =>
+ checkboxGroupValueController?.value = v;
+
+ @override
+ void initState(BuildContext context) {}
+
+ @override
+ void dispose() {
+ textFieldFocusNode?.dispose();
+ textController?.dispose();
+ }
+}
diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart
new file mode 100644
index 00000000..551004ef
--- /dev/null
+++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart
@@ -0,0 +1,330 @@
+import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart';
+import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart';
+import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart';
+import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
+
+class OptModalWidget extends StatefulWidget {
+ final String defaultPersonType;
+ final String defaultAccessType;
+
+ const OptModalWidget({
+ Key? key,
+ this.defaultPersonType = '.*',
+ this.defaultAccessType = '.*',
+ }) : super(key: key);
+
+ @override
+ _OptModalWidgetState createState() => _OptModalWidgetState();
+}
+
+class _OptModalWidgetState extends State {
+ late OptModalModel _model;
+
+ late Map selected;
+ final List