Worklist actions buttons updates

master
haroon amjad 6 months ago
parent 4e2a774086
commit d4b7550bab

@ -94,6 +94,12 @@ class ApiClient {
if (jsonData["IsAuthenticated"] != null) { if (jsonData["IsAuthenticated"] != null) {
AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; AppState().setIsAuthenticated = jsonData["IsAuthenticated"];
} }
// if(url.contains("GetOfferDiscountsConfigData")) {
// jsonData["ErrorMessage"] = "Service Not Available";
// jsonData["ErrorEndUserMessage"] = "Service Not Available";
// }
if (jsonData["ErrorMessage"] == null) { if (jsonData["ErrorMessage"] == null) {
return factoryConstructor(jsonData); return factoryConstructor(jsonData);
} else { } else {

@ -297,50 +297,52 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
], ],
).expanded, ).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable) if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
Container( SafeArea(
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), child: Container(
decoration: const BoxDecoration( padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
color: Colors.white, decoration: const BoxDecoration(
border: Border( color: Colors.white,
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), border: Border(
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0),
),
),
child: Row(
children: [
if (isRejectAvailable)
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction(rejectAction),
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction(approveAction),
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
],
), ),
),
child: Row(
children: [
if (isRejectAvailable)
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction(rejectAction),
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction(approveAction),
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
],
), ),
) )
], ],
@ -679,8 +681,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
void performAction(String actionMode, {String? title}) { void performAction(String actionMode, {String? title}) {
GetActionHistoryList? object = actionHistoryList.firstWhere((element) => element.aCTIONCODE == "REQUEST_INFO"); String question = "";
String question = "${object.aCTION}: ${object.nOTE}"; if (actionMode == "ANSWER_INFO") {
List<GetActionHistoryList> list = actionHistoryList.where((element) => element.aCTIONCODE == "REQUEST_INFO").toList();
if (list.isNotEmpty) {
question = "${list.first.aCTION}: ${list.first.nOTE}";
}
}
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext cxt) => AcceptRejectInputDialog( builder: (BuildContext cxt) => AcceptRejectInputDialog(

Loading…
Cancel
Save