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

@ -17,8 +17,9 @@ class ActionsFragment extends StatelessWidget {
int? notificationID;
List<GetActionHistoryList> actionHistoryList;
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
Widget build(BuildContext context) {
@ -113,42 +114,41 @@ class ActionsFragment extends StatelessWidget {
],
).paddingOnly(top: 19, left: 16, right: 16, bottom: 12),
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
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,
isShowActions
? Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: DelegateSheet(
title: LocaleKeys.delegate.tr(),
apiMode: "DELEGATE",
notificationID: notificationID,
actionHistoryList: actionHistoryList,
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,
));
return;
}
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: "DELEGATE",
actionHistoryList: actionHistory,
notificationID: notificationID,
),
);
}).expanded,
],
),
child: DelegateSheet(
title: LocaleKeys.delegate.tr(),
apiMode: "DELEGATE",
notificationID: notificationID,
actionHistoryList: actionHistoryList,
callBackFunc: voidCallback,
),
);
return;
}
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(LocaleKeys.comments.tr(), apiMode: "DELEGATE", actionHistoryList: actionHistory, notificationID: notificationID),
);
}).expanded,
],
)
: const SizedBox(),
],
),
],

Loading…
Cancel
Save