Refactor liberation history widget button callbacks
This commit is contained in:
parent
f27fc073ea
commit
ae5cf350ad
|
@ -228,14 +228,15 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
),
|
||||
icon: const Icon(Icons.done),
|
||||
onPressed: () async {
|
||||
return answersRequest.call(
|
||||
return answersRequest
|
||||
.call(
|
||||
context,
|
||||
liberationHistoryItem['NOT_ID'].toString(),
|
||||
'L',
|
||||
'',
|
||||
liberationHistoryItem['VTE_ID'].toString(),
|
||||
);
|
||||
|
||||
)
|
||||
.then((message) {
|
||||
if (message.isEmpty) {
|
||||
showSnackbar(
|
||||
context,
|
||||
|
@ -246,6 +247,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
} else {
|
||||
showSnackbar(context, message, true);
|
||||
}
|
||||
|
||||
safeSetState(() {
|
||||
_requestWrap = [];
|
||||
_requestFuture = _fetchRequests();
|
||||
});
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
},
|
||||
),
|
||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||
|
@ -266,14 +275,15 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () async {
|
||||
return answersRequest.call(
|
||||
return answersRequest
|
||||
.call(
|
||||
context,
|
||||
liberationHistoryItem['NOT_ID'].toString(),
|
||||
'B',
|
||||
'',
|
||||
liberationHistoryItem['VTE_ID'].toString(),
|
||||
);
|
||||
|
||||
)
|
||||
.then((message) {
|
||||
if (message.isEmpty) {
|
||||
showSnackbar(
|
||||
context,
|
||||
|
@ -284,6 +294,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
} else {
|
||||
showSnackbar(context, message, true);
|
||||
}
|
||||
|
||||
safeSetState(() {
|
||||
_requestWrap = [];
|
||||
_requestFuture = _fetchRequests();
|
||||
});
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue