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,42 +114,41 @@ 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
children: [ ? Row(
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { children: [
showMyBottomSheet( LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
context, showMyBottomSheet(
callBackFunc: voidCallback, context,
child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory),
);
}).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) {
showMyBottomSheet(context,
callBackFunc: voidCallback, callBackFunc: voidCallback,
child: DelegateSheet( child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory),
title: LocaleKeys.delegate.tr(), );
apiMode: "DELEGATE", }).expanded,
notificationID: notificationID, Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
actionHistoryList: actionHistoryList, LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) {
showMyBottomSheet(
context,
callBackFunc: voidCallback, callBackFunc: voidCallback,
)); child: DelegateSheet(
return; title: LocaleKeys.delegate.tr(),
} apiMode: "DELEGATE",
showMyBottomSheet( notificationID: notificationID,
context, actionHistoryList: actionHistoryList,
callBackFunc: voidCallback, callBackFunc: voidCallback,
child: SelectedItemSheet( ),
LocaleKeys.comments.tr(), );
apiMode: "DELEGATE", return;
actionHistoryList: actionHistory, }
notificationID: notificationID, showMyBottomSheet(
), context,
); callBackFunc: voidCallback,
}).expanded, child: SelectedItemSheet(LocaleKeys.comments.tr(), apiMode: "DELEGATE", actionHistoryList: actionHistory, notificationID: notificationID),
], );
), }).expanded,
],
)
: const SizedBox(),
], ],
), ),
], ],

Loading…
Cancel
Save