merge branches

This commit is contained in:
amirrezaghabeli
2025-08-20 13:11:22 +03:30
parent 1af9c0a76b
commit 4b51071aad
36 changed files with 1894 additions and 167 deletions
@@ -1,12 +1,22 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/view_models/tender_detail_view_model.dart';
import 'package:tm_app/views/shared/base_button.dart';
import 'package:tm_app/views/shared/select_submission_bottom_sheet.dart';
import '../../../data/services/model/tender_data/tender_data.dart';
class TenderDetailActions extends StatelessWidget {
final bool isScreenBig;
const TenderDetailActions({required this.isScreenBig, super.key});
final TenderData detail;
const TenderDetailActions({
required this.isScreenBig,
required this.detail,
super.key,
});
@override
Widget build(BuildContext context) {
@@ -36,22 +46,69 @@ class TenderDetailActions extends StatelessWidget {
)
: Column(
children: [
BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.primary30,
textColor: AppColors.mainBlue,
onPressed: () {},
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isSubmitApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.primary30,
textColor: AppColors.mainBlue,
isLoading: true,
onPressed: () {},
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderSubmitButton,
backgroundColor: AppColors.primary30,
textColor: AppColors.mainBlue,
onPressed: () {
showModalBottomSheet(
isDismissible: true,
context: context,
builder: (context) {
return SelectSubmissionBottomSheet(
onConfirm: (value) {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: value,
);
},
);
},
);
},
);
},
),
SizedBox(height: 16.0.h()),
BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
borderColor: AppColors.red10,
textColor: AppColors.red10,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {},
Consumer<TenderDetailViewModel>(
builder: (context, viewModel, child) {
return viewModel.isRejectApprovalLoading
? BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
borderColor: AppColors.error,
textColor: AppColors.error,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {},
)
: BaseButton(
isEnabled: true,
text: AppStrings.tenderRejectButton,
borderColor: AppColors.error,
textColor: AppColors.error,
backgroundColor: AppColors.backgroundColor,
borderWidth: 1,
onPressed: () {
viewModel.rejectTenderApproval(
tenderId: detail.id!,
submissionMode: 'self-apply',
);
},
);
},
),
SizedBox(height: 16.0.h()),
],