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?",
"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": {

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

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

@ -178,47 +178,45 @@ class MarathonFooter extends StatelessWidget {
}) : super(key: key);
Widget buildNoteForDemo() {
return Flexible(
child: RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: LocaleKeys.note.tr(),
style: const TextStyle(
color: MyColors.darkTextColor,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.bold,
),
return RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: LocaleKeys.note.tr(),
style: const TextStyle(
color: MyColors.darkTextColor,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.bold,
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP1.tr(),
style: const TextStyle(
color: MyColors.grey77Color,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP1.tr(),
style: const TextStyle(
color: MyColors.grey77Color,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.w500,
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP2.tr(),
style: const TextStyle(
color: MyColors.darkTextColor,
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP2.tr(),
style: const TextStyle(
color: MyColors.darkTextColor,
fontSize: 17,
fontWeight: FontWeight.bold,
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP3.tr(),
style: const TextStyle(
color: MyColors.grey77Color,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.w500,
),
)
],
),
),
TextSpan(
text: " " + LocaleKeys.demoMarathonNoteP3.tr(),
style: const TextStyle(
color: MyColors.grey77Color,
fontSize: 17,
letterSpacing: -0.64,
fontWeight: FontWeight.w500,
),
)
],
),
).paddingOnly(right: 21, left: 21, top: 11, bottom: 0);
}

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

@ -29,9 +29,8 @@ class MarathonScreen extends StatelessWidget {
child: Column(
children: <Widget>[
const MarathonHeader(),
20.height,
MarathonProgressContainer(provider: provider)
.paddingOnly(left: 21, right: 21),
20.height,
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),
],
),
],

@ -135,9 +135,7 @@ class AnswerContent extends StatelessWidget {
final DummyQuestionModel question;
final MarathonProvider provider;
const AnswerContent(
{Key? key, required this.question, required this.provider})
: super(key: key);
const AnswerContent({Key? key, required this.question, required this.provider}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -170,20 +168,18 @@ class AnswerContent extends StatelessWidget {
provider.startTimer(context);
provider.swipeCardLeft();
},
child: Flexible(
child: Container(
height: 60,
width: MediaQuery.of(context).size.width - 75,
alignment: Alignment.centerLeft,
decoration: MyDecorations.answerContainerDecoration,
child: Center(
child: Text(
question.opt1!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.w600,
fontSize: 16,
),
child: Container(
height: 60,
width: MediaQuery.of(context).size.width - 75,
alignment: Alignment.centerLeft,
decoration: MyDecorations.answerContainerDecoration,
child: Center(
child: Text(
question.opt1!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),

@ -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)) {
workListElement.value = AppState().workList?.length ?? 0;
providerData.workListCounter = providerData.workListCounter - ((tempList.first.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
providerData.notify();
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 - ((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