Merge branch 'master' into development_haroon

merge-requests/39/head
haroon amjad 3 years ago
commit 5840a6b4fa

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

@ -123,6 +123,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<GetOpenNotificationsList>? getOpenNotificationsList; List<GetOpenNotificationsList>? getOpenNotificationsList;
MohemmITGPendingTaskResponseItem? cocCount; MohemmITGPendingTaskResponseItem? cocCount;
int cocFinalCount = 0; int cocFinalCount = 0;
//Work List API's & Methods //Work List API's & Methods
Future fetchWorkListCounter(context, {bool showLoading = false}) async { Future fetchWorkListCounter(context, {bool showLoading = false}) async {
try { try {

@ -140,7 +140,7 @@ class _LoginScreenState extends State<LoginScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isAppOpenBySystem == null) { if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (kDebugMode) { if (kReleaseMode) {
// username.text = "15444"; // Maha User // username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User username.text = "15153"; // Tamer User
password.text = "Abcd@12345"; password.text = "Abcd@12345";

@ -178,8 +178,7 @@ class MarathonFooter extends StatelessWidget {
}) : super(key: key); }) : super(key: key);
Widget buildNoteForDemo() { Widget buildNoteForDemo() {
return Flexible( return RichText(
child: RichText(
text: TextSpan( text: TextSpan(
children: <InlineSpan>[ children: <InlineSpan>[
TextSpan( TextSpan(
@ -219,7 +218,6 @@ class MarathonFooter extends StatelessWidget {
) )
], ],
), ),
),
).paddingOnly(right: 21, left: 21, top: 11, bottom: 0); ).paddingOnly(right: 21, left: 21, top: 11, bottom: 0);
} }

@ -55,11 +55,13 @@ class MarathonProvider extends ChangeNotifier {
timer.cancel(); timer.cancel();
cancelTimer(); cancelTimer();
isMarathonCompleted = true; isMarathonCompleted = true;
await Future<dynamic>.delayed(const Duration(seconds: 3)); await Future<dynamic>.delayed(const Duration(seconds: 3)).whenComplete(
Navigator.pushReplacementNamed( () => Navigator.pushReplacementNamed(
context, context,
AppRoutes.marathonWinnerSelection, AppRoutes.marathonWinnerSelection,
),
); );
resetValues(); resetValues();
return; return;
@ -77,8 +79,9 @@ class MarathonProvider extends ChangeNotifier {
void resetValues() { void resetValues() {
timerU.cancel(); timerU.cancel();
isMarathonCompleted = false; _isMarathonCompleted = false;
currentQuestionNumber = 1; _currentQuestionNumber = 1;
notifyListeners();
} }
void cancelTimer() { void cancelTimer() {

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

@ -135,9 +135,7 @@ class AnswerContent extends StatelessWidget {
final DummyQuestionModel question; final DummyQuestionModel question;
final MarathonProvider provider; final MarathonProvider provider;
const AnswerContent( const AnswerContent({Key? key, required this.question, required this.provider}) : super(key: key);
{Key? key, required this.question, required this.provider})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -170,7 +168,6 @@ class AnswerContent extends StatelessWidget {
provider.startTimer(context); provider.startTimer(context);
provider.swipeCardLeft(); provider.swipeCardLeft();
}, },
child: Flexible(
child: Container( child: Container(
height: 60, height: 60,
width: MediaQuery.of(context).size.width - 75, width: MediaQuery.of(context).size.width - 75,
@ -188,7 +185,6 @@ class AnswerContent extends StatelessWidget {
), ),
), ),
), ),
),
const SizedBox(height: 15), const SizedBox(height: 15),
InkWell( InkWell(
onTap: () { onTap: () {

@ -210,6 +210,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1; AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
requestDetails = null; requestDetails = null;
itgRequest = null; itgRequest = null;
tabIndex = 0;
showFabOptions = false; showFabOptions = false;
getDataFromState(); getDataFromState();
} else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) { } 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(); var ids = widget.wFHistory!.map((e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID)); 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 @override

@ -131,16 +131,27 @@ class _WorkListScreenState extends State<WorkListScreen> {
} else if (workListElement.key == "COC") { } else if (workListElement.key == "COC") {
workListElement.value = providerData.cocFinalCount; workListElement.value = providerData.cocFinalCount;
} else { } else {
var tempList = providerData.getOpenNotificationsList?.where((notificationElement) { providerData.getOpenNotificationsList?.forEach((element) {
return (notificationElement.itemType == workListItemTypes[workListItemIndex].key) && notificationElement.itemType == workListElement.key; if ((element.itemType == workListItemTypes[workListItemIndex].key) && element.itemType == workListElement.key) {
}).toList(); if ((AppState().workList?.length ?? 0) != (element.openNtfNumber ?? 0)) {
if (tempList!.isNotEmpty) {
if ((AppState().workList?.length ?? 0) != (tempList.first.openNtfNumber ?? 0)) {
workListElement.value = AppState().workList?.length ?? 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(); 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; AppState().setWorkListIndex = AppState().workListIndex! + 1;
workListData = null; workListData = null;
showFabOptions = false; showFabOptions = false;
tabIndex = 0;
getDataFromState(); getDataFromState();
} else if (AppState().workList!.length - 1 == AppState().workListIndex!) { } else if (AppState().workList!.length - 1 == AppState().workListIndex!) {
Navigator.pop(context); 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") { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") {
continue; continue;
} }
fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "", fabs.add(myFab(
isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,) notificationButtonsList[i].bUTTONLABEL!,
.paddingOnly(bottom: 12) notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "",
.onPress(() => handleFabAction(notificationButtonsList[i]))); isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,
).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i])));
} }
return fabs; return fabs;
} }
void handleFabAction(GetNotificationButtonsList notificationButton) { void handleFabAction(GetNotificationButtonsList notificationButton) {
print("notificationButton:${notificationButton.bUTTONACTION}");
switch (notificationButton.bUTTONACTION) { switch (notificationButton.bUTTONACTION) {
case "DELEGATE": case "DELEGATE":
showMyBottomSheet(context, showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; break;
case "REQUEST_INFO": case "REQUEST_INFO":
// do something else // do something else
showMyBottomSheet(context, showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; 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": case "RFC":
// do something else // do something else
break; break;
@ -384,10 +394,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// do something else // do something else
case "APPROVE_AND_FORWARD": case "APPROVE_AND_FORWARD":
showMyBottomSheet(context, 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; break;
case "FORWARD": 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; break;
case "REJECT": case "REJECT":
performNetworkCall(context, email: "", userId: ""); 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(); TextEditingController textEditingController = TextEditingController();
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => AcceptRejectInputDialog( builder: (cxt) => AcceptRejectInputDialog(
message: LocaleKeys.requestedItems.tr(), message: title !=null ? null:LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput, notificationGetRespond: notificationNoteInput,
onTap: (note) { onTap: (note) {
Map<String, dynamic> payload = { Map<String, dynamic> payload = {

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

Loading…
Cancel
Save