|
|
|
@ -307,7 +307,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
myFab("Skip", "assets/images/skip.svg").onPress(() {
|
|
|
|
|
myFab(LocaleKeys.pleaseEnterComments.tr(), "assets/images/skip.svg").onPress(() {
|
|
|
|
|
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
|
|
|
|
|
AppState().setWorkListIndex = AppState().workListIndex! + 1;
|
|
|
|
|
workListData = null;
|
|
|
|
@ -481,6 +481,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
|
|
|
|
|
void performAction(String actionMode) {
|
|
|
|
|
TextEditingController textEditingController = TextEditingController();
|
|
|
|
|
print("actionMode:$actionMode");
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (cxt) => AcceptRejectInputDialog(
|
|
|
|
@ -488,7 +489,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
notificationGetRespond: notificationNoteInput,
|
|
|
|
|
textEditingController: textEditingController,
|
|
|
|
|
onTap: (note) {
|
|
|
|
|
if (note.isNotEmpty && (actionMode == "APPROVED" || actionMode == "APPROVE")) {
|
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
|
"P_ACTION_MODE": actionMode,
|
|
|
|
|
"P_APPROVER_INDEX": null,
|
|
|
|
@ -503,9 +503,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
if (actionMode == "APPROVED" || actionMode == "APPROVE") {
|
|
|
|
|
performNotificationAction(payload);
|
|
|
|
|
} else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) {
|
|
|
|
|
performNotificationAction(payload);
|
|
|
|
|
} else {
|
|
|
|
|
Utils.showToast("Please enter comments");
|
|
|
|
|
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
@ -518,7 +521,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
|
|
|
|
|
Navigator.pop(context, true);
|
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
} else {
|
|
|
|
|
if (AppState().workList!.length <= AppState().workListIndex!) {
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
} else {
|
|
|
|
|
workListData = null;
|
|
|
|
|
getDataFromState();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|