worklist actions fragment action button changes

mohem_flutter_upgrade
Aamir Muhammad 3 months ago
parent 8d6c3ddc0b
commit 5864c77226

@ -61,6 +61,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
int animationIndex = 0; int animationIndex = 0;
PageController controller = PageController(); PageController controller = PageController();
bool showFabOptions = false; bool showFabOptions = false;
bool isShowActions = false;
WorkListResponseModel? workListData; WorkListResponseModel? workListData;
MemberInformationListModel? memberInformationListModel; MemberInformationListModel? memberInformationListModel;
@ -286,6 +287,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
: ActionsFragment( : ActionsFragment(
workListData!.nOTIFICATIONID, workListData!.nOTIFICATIONID,
actionHistoryList, actionHistoryList,
isShowActions,
voidCallback: reloadWorkList, voidCallback: reloadWorkList,
) )
: showLoadingAnimation(), : showLoadingAnimation(),
@ -1077,6 +1079,14 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
return false; return false;
}); });
if(notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "DELEGATE" || element.bUTTONACTION == "REQUEST_INFO" )) {
isShowActions = true;
} else {
isShowActions = false;
}
} }
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {

@ -17,8 +17,9 @@ class ActionsFragment extends StatelessWidget {
int? notificationID; int? notificationID;
List<GetActionHistoryList> actionHistoryList; List<GetActionHistoryList> actionHistoryList;
VoidCallback voidCallback; VoidCallback voidCallback;
bool isShowActions = false;
ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key, required this.voidCallback}) : super(key: key); ActionsFragment(this.notificationID, this.actionHistoryList, this.isShowActions, {Key? key, required this.voidCallback}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -113,7 +114,8 @@ class ActionsFragment extends StatelessWidget {
], ],
).paddingOnly(top: 19, left: 16, right: 16, bottom: 12), ).paddingOnly(top: 19, left: 16, right: 16, bottom: 12),
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
Row( isShowActions
? Row(
children: [ children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet( showMyBottomSheet(
@ -125,7 +127,8 @@ class ActionsFragment extends StatelessWidget {
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) { if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) {
showMyBottomSheet(context, showMyBottomSheet(
context,
callBackFunc: voidCallback, callBackFunc: voidCallback,
child: DelegateSheet( child: DelegateSheet(
title: LocaleKeys.delegate.tr(), title: LocaleKeys.delegate.tr(),
@ -133,22 +136,19 @@ class ActionsFragment extends StatelessWidget {
notificationID: notificationID, notificationID: notificationID,
actionHistoryList: actionHistoryList, actionHistoryList: actionHistoryList,
callBackFunc: voidCallback, callBackFunc: voidCallback,
)); ),
);
return; return;
} }
showMyBottomSheet( showMyBottomSheet(
context, context,
callBackFunc: voidCallback, callBackFunc: voidCallback,
child: SelectedItemSheet( child: SelectedItemSheet(LocaleKeys.comments.tr(), apiMode: "DELEGATE", actionHistoryList: actionHistory, notificationID: notificationID),
LocaleKeys.comments.tr(),
apiMode: "DELEGATE",
actionHistoryList: actionHistory,
notificationID: notificationID,
),
); );
}).expanded, }).expanded,
], ],
), )
: const SizedBox(),
], ],
), ),
], ],

Loading…
Cancel
Save