diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 56a7c21..3c3c504 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -420,7 +420,7 @@ "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": { diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index dc9375d..7a6f668 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -81,8 +81,8 @@ class ApiClient { } if (!kReleaseMode) { print("Url:$url"); - // var bodyJson = json.encode(jsonObject); - // print("body:$bodyJson"); + var bodyJson = json.encode(jsonObject); + print("body:$bodyJson"); } var response = await postJsonForResponse(url, jsonObject, token: token, diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 39f33a4..439a5f4 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -116,6 +116,8 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), + confirmText: Text(LocaleKeys.confirm.tr()), + cancelText: Text(LocaleKeys.cancel.tr()), ).then((selectedDate) { if (selectedDate != null) { searchMonth = getMonth(selectedDate.month); diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index e33dad8..d0e167d 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -70,6 +70,7 @@ class _EmployeeDetailsState extends State { extendBody: true, backgroundColor: MyColors.lightGreyEFColor, body: Stack(children: [ + getEmployeeSubordinates!.eMPLOYEEIMAGE != null ? Container( height: 200, margin: EdgeInsets.only(top: 30), @@ -80,6 +81,8 @@ class _EmployeeDetailsState extends State { decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), ), ), + ) : Container( + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), ), SingleChildScrollView( scrollDirection: Axis.vertical, diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 5d55ee8..c77b1b4 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -169,6 +169,8 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), + confirmText: Text(LocaleKeys.confirm.tr()), + cancelText: Text(LocaleKeys.cancel.tr()), ).then( (selectedDate) { if (selectedDate != null) { diff --git a/lib/ui/profile/profile_screen.dart b/lib/ui/profile/profile_screen.dart index 690633b..c071d3f 100644 --- a/lib/ui/profile/profile_screen.dart +++ b/lib/ui/profile/profile_screen.dart @@ -44,23 +44,26 @@ class _ProfileScreenState extends State { backgroundColor: const Color(0xffefefef), body: Stack( children: [ - Container( - height: 300, - margin: const EdgeInsets.only(top: 50), - decoration: BoxDecoration( + memberInformationList!.eMPLOYEEIMAGE != null + ? Container( + height: 300, + margin: const EdgeInsets.only(top: 50), + decoration: BoxDecoration( image: DecorationImage( image: MemoryImage( Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!), ), fit: BoxFit.cover), ), - child: BackdropFilter( + child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), child: Container( color: Colors.white.withOpacity(0.0), ), ), - ), + ): Container( + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), + ), SingleChildScrollView( scrollDirection: Axis.vertical, child: Column( diff --git a/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index 75b33c9..2f963a7 100644 --- a/lib/ui/work_list/sheets/delegate_sheet.dart +++ b/lib/ui/work_list/sheets/delegate_sheet.dart @@ -407,10 +407,10 @@ class _DelegateSheetState extends State { child: Row( children: [ CircularAvatar( - url: actionHistory.employeeImage ?? "", + url: actionHistory.employeeImage, height: 30, width: 30, - isImageBase64: true, + isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false, ), 16.width, Expanded( @@ -452,10 +452,10 @@ class _DelegateSheetState extends State { child: Row( children: [ CircularAvatar( - url: actionHistory.employeeImage ?? "", + url: actionHistory.employeeImage, height: 30, width: 30, - isImageBase64: true, + isImageBase64: actionHistory.employeeImage != null ? true : false, ), 16.width, Expanded( diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index d406ef3..f3f8f0d 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -142,10 +142,17 @@ class SelectedItemSheet extends StatelessWidget { padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21), child: Row( children: [ - CircularAvatar( - height: 30, - width: 30, - ), + actionHistoryList != null + ? CircularAvatar( + height: 30, + width: 30, + url: actionHistoryList!.eMPLOYEEIMAGE, + isImageBase64: true, + ) + : CircularAvatar( + height: 30, + width: 30, + ), 16.width, Expanded( child: (name ?? "").toText12(), diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index f2cd760..b1c2b1e 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -307,7 +307,7 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - myFab(LocaleKeys.pleaseEnterComments.tr(), "assets/images/skip.svg").onPress(() { + myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { if (AppState().workList!.length - 1 > AppState().workListIndex!) { AppState().setWorkListIndex = AppState().workListIndex! + 1; workListData = null; @@ -354,7 +354,8 @@ class _WorkListDetailScreenState extends State { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") { continue; } - fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONICON ?? "", isIconAsset: false) + 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]))); } @@ -778,7 +779,7 @@ class _WorkListDetailScreenState extends State { // apiCallCount--; // if (apiCallCount == 0) { // Utils.hideLoading(context); - setState(() {}); + setState(() {}); // } } catch (ex) { // apiCallCount--; diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 16a60e0..7cf8aa9 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -440,7 +440,7 @@ class InfoFragment extends StatelessWidget { Widget getPRNotificationBodyListWidget(GetPrNotificationBodyList getPrNotificationBodyList) { return Column( children: [ - getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView(), + getPrNotificationBodyList.pINFORMATION != null ? getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView() : Container(), 12.height, Column( children: [ @@ -456,21 +456,23 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), ), - ItemDetailGrid( - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTEVALUE ?? ""), - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTEVALUE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - Container(), - isItLast: true, - ), + Column( + children: getPRHeaderValues(), + ) ], ).objectContainerView(), ], ); } + List getPRHeaderValues() { + List pRHeaders = []; + getPrNotificationBodyList!.pRHeader!.forEach((element) { + pRHeaders.add(ItemDetailGrid(ItemDetailViewCol(element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!), Container())); + }); + return pRHeaders; + } + Widget getContactNotificationBodyListWidget(GetContactNotificationBodyList data) { bool isOdd = false; try { diff --git a/lib/ui/work_list/worklist_fragments/request_fragment.dart b/lib/ui/work_list/worklist_fragments/request_fragment.dart index b900578..b86bb1a 100644 --- a/lib/ui/work_list/worklist_fragments/request_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/request_fragment.dart @@ -115,37 +115,42 @@ class RequestFragment extends StatelessWidget { } Widget prLinesDataView() { - return Column( - children: [ - prLinesList[0].dESCRIPTION.toString().toText14(color: MyColors.textMixColor).objectContainerView(), - 12.height, - Column( - children: [ - ItemDetailGrid( - ItemDetailViewCol("Cost Center", prLinesList[0].cOSTCENTER ?? ""), - ItemDetailViewCol("Code", prLinesList[0].iTEMCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Unit", prLinesList[0].uOM ?? ""), - ItemDetailViewCol("Price (SAR)", prLinesList[0].uNITPRICE.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Amount (SAR)", prLinesList[0].lINEAMOUNT.toString() ?? ""), - ItemDetailViewCol("Quantity", prLinesList[0].qUANTITY.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("AMU (Last 3 months)", prLinesList[0].iTEMAMU.toString() ?? ""), - Container(), - isItLast: true, - ), - // ItemDetailGrid( - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - // Container(), - // isItLast: true, - // ), - ], - ).objectContainerView(), - ], + return ExpandableNotifier( + child: ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => ExpandablePanel( + header: prLinesList[index].dESCRIPTION.toString().toText14(color: MyColors.textMixColor), + collapsed: Column( + children: [ + ItemDetailGrid( + ItemDetailViewCol("Cost Center", prLinesList[index].cOSTCENTER ?? ""), + ItemDetailViewCol("Code", prLinesList[index].iTEMCODE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("Unit", prLinesList[index].uOM ?? ""), + ItemDetailViewCol("Price (SAR)", prLinesList[index].uNITPRICE.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("Amount (SAR)", prLinesList[index].lINEAMOUNT.toString() ?? ""), + ItemDetailViewCol("Quantity", prLinesList[index].qUANTITY.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("AMU (Last 3 months)", prLinesList[index].iTEMAMU.toString() ?? ""), + Container(), + isItLast: true, + ), + // ItemDetailGrid( + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), + // Container(), + // isItLast: true, + // ), + ], + ), + expanded: const SizedBox(), + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: prLinesList.length), ); }