From f5c1edcf6c759ca367243861c0db73cef2a0a4a5 Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Tue, 12 Nov 2024 15:36:39 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20exibi=C3=A7=C3=A3o=20da=20snackbar=20e?= =?UTF-8?q?=20atualiza=C3=A7=C3=A3o=20da=20libera=C3=A7=C3=A3o=20ap=C3=B3s?= =?UTF-8?q?=20resolu=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liberation_history_widget.dart | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 2b39c940..4eba3c0a 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -230,12 +230,6 @@ class _LiberationHistoryWidgetState extends State { ) .then((value) { if (value) { - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - - context.pop(); SnackBarUtil.showSnackBar( context, FFLocalizations.of(context).getVariableText( @@ -254,7 +248,14 @@ class _LiberationHistoryWidgetState extends State { isError: true, ); } - }).whenComplete(() {}); + }).whenComplete(() { + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + + context.pop(); + }); }, ), if (liberationHistoryItem['NOT_STATUS'] == 'S') @@ -283,12 +284,7 @@ class _LiberationHistoryWidgetState extends State { id: liberationHistoryItem['VTE_ID'].toString(), ) .then((message) { - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - context.pop(); - if (message == null || message == '') { + if (message != null || message != '') { showSnackbar( context, FFLocalizations.of(context).getVariableText( @@ -300,7 +296,13 @@ class _LiberationHistoryWidgetState extends State { } else { showSnackbar(context, message, true); } - }).whenComplete(() {}); + }).whenComplete(() { + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + context.pop(); + }); }, ) ],