fix web bug and navigations

This commit is contained in:
amirrezaghabeli
2025-08-27 07:38:09 +03:30
parent 9b87221e3e
commit 18834e492d
5 changed files with 270 additions and 147 deletions
@@ -21,83 +21,7 @@ class TenderDetailActions extends StatelessWidget {
@override
Widget build(BuildContext context) {
return isScreenBig
? Row(
children: [
Spacer(),
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isRejectApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
textColor: AppColors.red10,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {},
width: 120.0.w(),
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
textColor: AppColors.red10,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {
viewModel.rejectTenderApproval(
tenderId: detail.id!,
submissionMode: 'self-apply',
);
},
width: 120.0.w(),
);
},
),
SizedBox(width: 5.0.w()),
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isSubmitApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.lightBlue,
textColor: AppColors.mainBlue,
onPressed: () {},
width: 120.0.w(),
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.lightBlue,
textColor: AppColors.mainBlue,
onPressed: () {
if (viewModel.status == 'submitted') {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: 'self-apply',
);
} else {
showModalBottomSheet(
isDismissible: true,
context: context,
builder: (context) {
return SelectSubmissionBottomSheet(
onConfirm: (value) {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: value,
);
},
);
},
);
}
},
width: 120.0.w(),
);
},
),
],
)
? _webActions()
: Column(
children: [
Consumer<TenderDetailViewModel>(
@@ -180,4 +104,84 @@ class TenderDetailActions extends StatelessWidget {
],
);
}
Row _webActions() {
return Row(
children: [
Spacer(),
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isRejectApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
textColor: AppColors.red10,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {},
width: 120.0.w(),
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
textColor: AppColors.red10,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {
viewModel.rejectTenderApproval(
tenderId: detail.id!,
submissionMode: 'self-apply',
);
},
width: 120.0.w(),
);
},
),
SizedBox(width: 5.0.w()),
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isSubmitApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.lightBlue,
textColor: AppColors.mainBlue,
onPressed: () {},
width: 120.0.w(),
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.lightBlue,
textColor: AppColors.mainBlue,
onPressed: () {
if (viewModel.status == 'submitted') {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: 'self-apply',
);
} else {
showModalBottomSheet(
isDismissible: true,
context: context,
builder: (context) {
return SelectSubmissionBottomSheet(
onConfirm: (value) {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: value,
);
},
);
},
);
}
},
width: 120.0.w(),
);
},
),
],
);
}
}