issues fixed.

merge-requests/33/head
Sikander Saleem 3 years ago
parent b9ee1230b6
commit 1cd7cd4d76

@ -932,7 +932,7 @@ static const Map<String,dynamic> en_US = {
"updateMember": "Are You Sure You Want to Update this Member?",
"fieldIsEmpty": "'{data}' Field is empty. Please select",
"pleaseEnterComments": "Please enter comments",
"skip": "skip",
"skip": "Skip",
"typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password",
"profile": {

@ -30,8 +30,7 @@ class MarathonScreen extends StatelessWidget {
children: <Widget>[
const MarathonHeader(),
20.height,
MarathonProgressContainer(provider: provider)
.paddingOnly(left: 21, right: 21),
MarathonProgressContainer(provider: provider).paddingOnly(left: 21, right: 21),
if (provider.isMarathonCompleted)
InkWell(
onTap: () {
@ -58,17 +57,12 @@ class MarathonScreen extends StatelessWidget {
subTitle: Text(
LocaleKeys.allQuestionsCorrect.tr(),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: MyColors.darkTextColor,
letterSpacing: -1.08),
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: MyColors.darkTextColor, letterSpacing: -1.08),
),
).paddingOnly(top: 12, left: 21, right: 21),
)
else
QuestionCard(provider: provider)
.paddingOnly(top: 12, left: 21, right: 21),
QuestionCard(provider: provider).paddingOnly(top: 12, left: 21, right: 21),
],
),
),
@ -79,12 +73,10 @@ class MarathonScreen extends StatelessWidget {
class MarathonProgressContainer extends StatefulWidget {
final MarathonProvider provider;
const MarathonProgressContainer({Key? key, required this.provider})
: super(key: key);
const MarathonProgressContainer({Key? key, required this.provider}) : super(key: key);
@override
State<MarathonProgressContainer> createState() =>
_MarathonProgressContainerState();
State<MarathonProgressContainer> createState() => _MarathonProgressContainerState();
}
class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
@ -107,7 +99,7 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
return Container(
width: double.infinity,
decoration: MyDecorations.shadowDecoration,
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
padding: const EdgeInsets.all(21),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
@ -120,18 +112,15 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 8),
child:
"${widget.provider.currentQuestionNumber.toString()} / ${widget.provider.totalQuestions.toString()} ${LocaleKeys.question.tr()}"
.toText12(color: MyColors.white),
child: "${widget.provider.currentQuestionNumber.toString()} / ${widget.provider.totalQuestions.toString()} ${LocaleKeys.question.tr()}".toText12(color: MyColors.white),
),
"23 ${LocaleKeys.marathoners.tr()}".toText14(),
"00:${widget.provider.start < 10 ? "0${widget.provider.start}" : widget.provider.start}"
.toText18(),
"00:${widget.provider.start < 10 ? "0${widget.provider.start}" : widget.provider.start}".toText18(),
],
),
15.height,
StepsIndicator(
lineLength: 23,
lineLength: 21,
nbSteps: 10,
selectedStep: widget.provider.currentQuestionNumber,
doneLineColor: MyColors.greenColor,
@ -152,8 +141,7 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
12.height,
Row(
children: <Widget>[
"${widget.provider.currentQuestionNumber * 10}% ${LocaleKeys.completed.tr()}"
.toText14(isBold: true),
"${widget.provider.currentQuestionNumber * 10}% ${LocaleKeys.completed.tr()}".toText14(isBold: true),
],
),
],

@ -210,6 +210,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
requestDetails = null;
itgRequest = null;
tabIndex = 0;
showFabOptions = false;
getDataFromState();
} else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) {

@ -54,6 +54,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
var ids = widget.wFHistory!.map((e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID));
}
if (widget.actionHistoryList != null) {
widget.actionHistoryList = widget.actionHistoryList!.reversed.toList();
var ids = widget.actionHistoryList!.map((e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((x) => ids.remove(x.uSERNAME));
}
}
@override

@ -131,16 +131,27 @@ class _WorkListScreenState extends State<WorkListScreen> {
} else if (workListElement.key == "COC") {
workListElement.value = providerData.cocFinalCount;
} else {
var tempList = providerData.getOpenNotificationsList?.where((notificationElement) {
return (notificationElement.itemType == workListItemTypes[workListItemIndex].key) && notificationElement.itemType == workListElement.key;
}).toList();
if (tempList!.isNotEmpty) {
if ((AppState().workList?.length ?? 0) != (tempList.first.openNtfNumber ?? 0)) {
providerData.getOpenNotificationsList?.forEach((element) {
if ((element.itemType == workListItemTypes[workListItemIndex].key) && element.itemType == workListElement.key) {
if ((AppState().workList?.length ?? 0) != (element.openNtfNumber ?? 0)) {
workListElement.value = AppState().workList?.length ?? 0;
providerData.workListCounter = providerData.workListCounter - ((tempList.first.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
providerData.workListCounter = providerData.workListCounter - ((element.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
element.openNtfNumber = workListElement.value;
providerData.notify();
}
}
});
// var tempList = providerData.getOpenNotificationsList?.where((notificationElement) {
// return (notificationElement.itemType == workListItemTypes[workListItemIndex].key) && notificationElement.itemType == workListElement.key;
// }).toList();
// if (tempList!.isNotEmpty) {
// if ((AppState().workList?.length ?? 0) != (tempList.first.openNtfNumber ?? 0)) {
// workListElement.value = AppState().workList?.length ?? 0;
// providerData.workListCounter = providerData.workListCounter - ((tempList.first.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
// providerData.notify();
// }
// }
}
});
}

@ -312,6 +312,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
AppState().setWorkListIndex = AppState().workListIndex! + 1;
workListData = null;
showFabOptions = false;
tabIndex = 0;
getDataFromState();
} else if (AppState().workList!.length - 1 == AppState().workListIndex!) {
Navigator.pop(context);
@ -354,26 +355,35 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") {
continue;
}
fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "",
isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,)
.paddingOnly(bottom: 12)
.onPress(() => handleFabAction(notificationButtonsList[i])));
fabs.add(myFab(
notificationButtonsList[i].bUTTONLABEL!,
notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "",
isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,
).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i])));
}
return fabs;
}
void handleFabAction(GetNotificationButtonsList notificationButton) {
print("notificationButton:${notificationButton.bUTTONACTION}");
switch (notificationButton.bUTTONACTION) {
case "DELEGATE":
showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REQUEST_INFO":
// do something else
showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "TRANSFER_INFO":
// do something else
showMyBottomSheet(context,
child: DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "ANSWER_INFO":
performAction(notificationButton.bUTTONACTION!,title: notificationButton.bUTTONLABEL);
break;
case "RFC":
// do something else
break;
@ -384,10 +394,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// do something else
case "APPROVE_AND_FORWARD":
showMyBottomSheet(context,
child: DelegateSheet(title: "Approve and Forward", apiMode: "APPROVE_AND_FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
child: DelegateSheet(title: "Approve and Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "FORWARD":
showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: "FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REJECT":
performNetworkCall(context, email: "", userId: "");
@ -480,12 +490,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
);
}
void performAction(String actionMode) {
void performAction(String actionMode,{String? title}) {
TextEditingController textEditingController = TextEditingController();
showDialog(
context: context,
builder: (cxt) => AcceptRejectInputDialog(
message: LocaleKeys.requestedItems.tr(),
message: title !=null ? null:LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput,
onTap: (note) {
Map<String, dynamic> payload = {

@ -124,6 +124,7 @@ class ActionsFragment extends StatelessWidget {
}
Color getStatusColor(String code) {
print("code:$code");
if (code == "SUBMIT") {
return const Color(0xff2E303A);
} else if (code == "REJECTED") {
@ -134,10 +135,10 @@ class ActionsFragment extends StatelessWidget {
return MyColors.orange;
} else if (code == "APPROVED" || code == "APPROVE") {
return const Color(0xff1FA269);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;
} else if (code == "REQUEST_INFO") {
return const Color(0xff2E303A);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;
} else {
return const Color(0xff2E303A);
}

Loading…
Cancel
Save