From 1419df1ac177313b70e3cff1dde1d8a59b114133 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Tue, 20 Aug 2024 08:31:58 -0300 Subject: [PATCH] =?UTF-8?q?FIX:=20Prioriza=C3=A7=C3=A3o=20na=20Requisi?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20Solicita=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liberation_history_widget.dart | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index d24c4d29..1d400e40 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -218,29 +218,28 @@ class _LiberationHistoryWidgetState extends State { ), icon: const Icon(Icons.done), onPressed: () async { - Navigator.pop(context); - - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - - var message = await answersRequest.call( + return answersRequest.call( context, liberationHistoryItem['NOT_ID'].toString(), 'L', '', liberationHistoryItem['VTE_ID'].toString(), - ); + ).then((message) { + if (message.isEmpty) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); + } else { + showSnackbar(context, message, true); + } - if (message.isEmpty) { - showSnackbar( - context, - FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); - } else { - showSnackbar(context, message, true); - } + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + Navigator.pop(context); + }); }, ), if (liberationHistoryItem['NOT_STATUS'] == 'S') @@ -260,29 +259,28 @@ class _LiberationHistoryWidgetState extends State { ), icon: const Icon(Icons.close), onPressed: () async { - Navigator.pop(context); - - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - - var message = await answersRequest.call( + return answersRequest.call( context, liberationHistoryItem['NOT_ID'].toString(), 'B', '', liberationHistoryItem['VTE_ID'].toString(), - ); + ).then((message) { + if (message.isEmpty) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); + } else { + showSnackbar(context, message, true); + } - if (message.isEmpty) { - showSnackbar( - context, - FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); - } else { - showSnackbar(context, message, true); - } + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + Navigator.pop(context); + }); }, ) ],