Merge branch 'develop' into feature/fd-466

This commit is contained in:
J. A. Messias 2024-11-04 15:27:16 -03:00
commit 835da52da0
6 changed files with 34 additions and 27 deletions

View File

@ -181,7 +181,7 @@ Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, Stri
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'Name', enText: 'Name',
ptText: 'Nome', ptText: 'Nome',
): payload['PES_NOME'].toString(), ): payload['PES_NOME'] != null ? payload['PES_NOME'].toString() : payload['USR_NOME'].toString(),
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'Type', enText: 'Type',
ptText: 'Tipo', ptText: 'Tipo',

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:easy_debounce/easy_debounce.dart'; import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -61,9 +63,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 0.0, 24.0), padding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 0.0, 24.0),
child: Text( child: Text(
FFLocalizations.of(context).getText( FFLocalizations.of(context).getText('uj8acuab'),
'uj8acuab' /* Preencha os Campos Abaixo: */,
),
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
@ -585,7 +585,6 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
nome: model.personNameTextController.text, nome: model.personNameTextController.text,
proID: model.ownerUUID, proID: model.ownerUUID,
); );
if (PhpGroup.postProvVisitSchedulingCall if (PhpGroup.postProvVisitSchedulingCall
.error((model.provVisitSchedule?.jsonBody ?? '')) == .error((model.provVisitSchedule?.jsonBody ?? '')) ==
false) { false) {
@ -596,7 +595,6 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
enText: "Provisional Scheduling Successfully Completed")); enText: "Provisional Scheduling Successfully Completed"));
safeSetState(() { safeSetState(() {
model.dateTimeTextController?.clear(); model.dateTimeTextController?.clear();
model.personNameTextController?.clear(); model.personNameTextController?.clear();
model.notesTextController?.clear(); model.notesTextController?.clear();
}); });
@ -609,7 +607,6 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
} }
} }
setState(() {}); setState(() {});
} catch (e, s) { } catch (e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
@ -633,10 +630,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
), ),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide( borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
color: Colors.transparent,
width: 1.0,
),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
disabledColor: FlutterFlowTheme.of(context).customColor5, disabledColor: FlutterFlowTheme.of(context).customColor5,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,

View File

@ -50,10 +50,7 @@ class _DeliveryScheduleState extends State<DeliverySchedule> {
}, },
), ),
title: Text( title: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(enText: 'Delivery Schedule', ptText: 'Agendar Entregas'),
enText: 'Delivery Schedule',
ptText: 'Agendar Entregas',
),
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,

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.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/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';
@ -45,23 +47,32 @@ class PreferencesPageModel with ChangeNotifier {
); );
onConfirm() async { onConfirm() async {
String content; String content;
try { String value = StorageUtil().notify ? 'N' : 'S';
await PhpGroup.changeNotifica.call(notifica: value).then((value) async {
if (value.jsonBody['error'] == false) {
StorageUtil().notify = !StorageUtil().notify;
notifyListeners();
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',
); );
context.pop();
SnackBarUtil.showSnackBar(context, content); SnackBarUtil.showSnackBar(context, content);
StorageUtil().notify = !StorageUtil().notify; } else {
notifyListeners();
} catch (err) {
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',
); );
context.pop();
SnackBarUtil.showSnackBar(context, content, isError: true); SnackBarUtil.showSnackBar(context, content, isError: true);
} }
}).catchError((e, s) {
log('toggleNotify', error: e, stackTrace: s);
content = FFLocalizations.of(context).getVariableText(
enText: 'Error changing notification',
ptText: 'Erro ao alterar notificação',
);
SnackBarUtil.showSnackBar(context, content, isError: true);
}).whenComplete(() => notifyListeners());
context.pop();
} }
showAlertDialog(context, title, content, onConfirm); showAlertDialog(context, title, content, onConfirm);

View File

@ -84,6 +84,7 @@ class AuthenticationService {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
} else { } else {
DialogUtil.error(context, response.jsonBody['error_msg'].toString()); DialogUtil.error(context, response.jsonBody['error_msg'].toString());
DialogUtil.error(context, response.jsonBody['error_msg'].toString());
} }
} }
} }
@ -162,6 +163,7 @@ class AuthenticationService {
} catch (e, s) { } catch (e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed('forgotPassword.php', email, "Forgot Password", e, s); LogUtil.requestAPIFailed('forgotPassword.php', email, "Forgot Password", e, s);
LogUtil.requestAPIFailed('forgotPassword.php', email, "Forgot Password", e, s);
} }
} }
@ -183,6 +185,7 @@ class AuthenticationService {
} catch (e, s) { } catch (e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed('changePassword.php', email, "Change Password", e, s); LogUtil.requestAPIFailed('changePassword.php', email, "Change Password", e, s);
LogUtil.requestAPIFailed('changePassword.php', email, "Change Password", e, s);
} }
} }

View File

@ -161,6 +161,7 @@ class StorageUtil {
Future<void> initSecureStorage() async { Future<void> initSecureStorage() async {
log('SecureStorageHelper: Starting initialization'); log('SecureStorageHelper: Starting initialization');
try { try {
if (_initialized) _secureStorage = SecureStorageHelper();
if (_initialized) _secureStorage = SecureStorageHelper(); if (_initialized) _secureStorage = SecureStorageHelper();
_email = await _secureStorage.getString('fre_email'); _email = await _secureStorage.getString('fre_email');
_passwd = await _secureStorage.getString('fre_passwd'); _passwd = await _secureStorage.getString('fre_passwd');
@ -172,6 +173,7 @@ class StorageUtil {
_fingerprintPass = await _secureStorage.getString('fre_fingerprintPass'); _fingerprintPass = await _secureStorage.getString('fre_fingerprintPass');
_haveLocal = await _secureStorage.getBool('fre_have_local') ?? false; _haveLocal = await _secureStorage.getBool('fre_have_local') ?? false;
_deviceDescription = await _secureStorage.getString('fre_deviceDescription'); _deviceDescription = await _secureStorage.getString('fre_deviceDescription');
_deviceDescription = await _secureStorage.getString('fre_deviceDescription');
} catch (e, s) { } catch (e, s) {
log('SecureStorageHelper: Error during initialization: $e'); log('SecureStorageHelper: Error during initialization: $e');
LogUtil.requestAPIFailed('$UniqueKey', '$UniqueKey', 'SecureStorageHelper', e, s); LogUtil.requestAPIFailed('$UniqueKey', '$UniqueKey', 'SecureStorageHelper', e, s);