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),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
return answersRequest.call(
|
return answersRequest
|
||||||
|
.call(
|
||||||
context,
|
context,
|
||||||
liberationHistoryItem['NOT_ID'].toString(),
|
liberationHistoryItem['NOT_ID'].toString(),
|
||||||
'L',
|
'L',
|
||||||
'',
|
'',
|
||||||
liberationHistoryItem['VTE_ID'].toString(),
|
liberationHistoryItem['VTE_ID'].toString(),
|
||||||
);
|
)
|
||||||
|
.then((message) {
|
||||||
if (message.isEmpty) {
|
if (message.isEmpty) {
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
context,
|
context,
|
||||||
|
@ -246,6 +247,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
} else {
|
} else {
|
||||||
showSnackbar(context, message, true);
|
showSnackbar(context, message, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
safeSetState(() {
|
||||||
|
_requestWrap = [];
|
||||||
|
_requestFuture = _fetchRequests();
|
||||||
|
});
|
||||||
|
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||||
|
@ -266,14 +275,15 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
return answersRequest.call(
|
return answersRequest
|
||||||
|
.call(
|
||||||
context,
|
context,
|
||||||
liberationHistoryItem['NOT_ID'].toString(),
|
liberationHistoryItem['NOT_ID'].toString(),
|
||||||
'B',
|
'B',
|
||||||
'',
|
'',
|
||||||
liberationHistoryItem['VTE_ID'].toString(),
|
liberationHistoryItem['VTE_ID'].toString(),
|
||||||
);
|
)
|
||||||
|
.then((message) {
|
||||||
if (message.isEmpty) {
|
if (message.isEmpty) {
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
context,
|
context,
|
||||||
|
@ -284,6 +294,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
} else {
|
} else {
|
||||||
showSnackbar(context, message, true);
|
showSnackbar(context, message, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
safeSetState(() {
|
||||||
|
_requestWrap = [];
|
||||||
|
_requestFuture = _fetchRequests();
|
||||||
|
});
|
||||||
|
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue