From 2704fcd147dab76c5f22591cd48db06dd07ad99b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 26 Oct 2022 10:57:07 +0300 Subject: [PATCH] PR Fixes --- .../worklist_fragments/info_fragments.dart | 29 +++++--- .../worklist_fragments/request_fragment.dart | 67 ++++++++++--------- 2 files changed, 56 insertions(+), 40 deletions(-) diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 16a60e0..fb6a8e3 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -456,21 +456,32 @@ 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(), + ) + // 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, + // ), ], ).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), ); }