added web tablet pages
This commit is contained in:
@@ -5,8 +5,9 @@ import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/views/detail/strings/tender_details_strings.dart';
|
||||
|
||||
class SelectMeetingTimeBottomSheet extends StatefulWidget {
|
||||
const SelectMeetingTimeBottomSheet({required this.onConfirm, super.key});
|
||||
const SelectMeetingTimeBottomSheet({required this.onConfirm, required this.isDialog, super.key});
|
||||
final ValueChanged<String> onConfirm;
|
||||
final bool isDialog;
|
||||
|
||||
@override
|
||||
State<SelectMeetingTimeBottomSheet> createState() =>
|
||||
@@ -35,7 +36,7 @@ class _SelectMeetingTimeBottomSheetState
|
||||
padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.backgroundColor,
|
||||
borderRadius: const BorderRadius.only(
|
||||
borderRadius: widget.isDialog ? const BorderRadius.all(Radius.circular(16.0)) : const BorderRadius.only(
|
||||
topLeft: Radius.circular(16.0),
|
||||
topRight: Radius.circular(16.0),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/views/detail/widgets/select_meeting_time_bottom_sheet.dart';
|
||||
|
||||
Future<void> showSelectMeetingTimeDialog({
|
||||
required BuildContext context,
|
||||
required ValueChanged<String> onConfirm,
|
||||
}) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (dialogContext) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
insetPadding: const EdgeInsets.symmetric(horizontal: 32, vertical: 24),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 500),
|
||||
child: SelectMeetingTimeBottomSheet(
|
||||
isDialog: true,
|
||||
onConfirm: (value) {
|
||||
onConfirm(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ 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/detail/widgets/select_meeting_time_bottom_sheet.dart';
|
||||
import 'package:tm_app/views/detail/widgets/show_select_meeting_time_bottom_sheet.dart';
|
||||
import 'package:tm_app/views/shared/base_button.dart';
|
||||
import 'package:tm_app/views/shared/select_submission_bottom_sheet.dart';
|
||||
|
||||
@@ -53,28 +54,28 @@ class TenderDetailActions extends StatelessWidget {
|
||||
onPressed: () {
|
||||
{
|
||||
showModalBottomSheet(
|
||||
isDismissible: true,
|
||||
context: context,
|
||||
builder: (bottomSheetContext) {
|
||||
builder: (context) {
|
||||
return SelectSubmissionBottomSheet(
|
||||
onConfirm: (value) {
|
||||
// viewModel.submitTenderApproval(
|
||||
// tenderId: detail.id!,
|
||||
// submissionMode: value,
|
||||
// );
|
||||
onConfirm: (String value) {
|
||||
if (value ==
|
||||
TenderSubmissionMode.selfApply.value) {
|
||||
const CompletionOfDocumentsMobileRouteData()
|
||||
.push(context);
|
||||
} else {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: value,
|
||||
);
|
||||
} else if (value ==
|
||||
TenderSubmissionMode.partnership.value) {
|
||||
Future.delayed(Duration.zero, () {
|
||||
showModalBottomSheet(
|
||||
isDismissible: true,
|
||||
// ignore: use_build_context_synchronously
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return SelectMeetingTimeBottomSheet(
|
||||
onConfirm: (meetingTime) {},
|
||||
onConfirm: (String value) {
|
||||
const CompletionOfDocumentsRouteData()
|
||||
.push(context);
|
||||
},
|
||||
isDialog: false,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -186,10 +187,24 @@ class TenderDetailActions extends StatelessWidget {
|
||||
builder: (context) {
|
||||
return SelectSubmissionDialog(
|
||||
onConfirm: (String value) {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: value,
|
||||
);
|
||||
if (value ==
|
||||
TenderSubmissionMode.selfApply.value) {
|
||||
const FinalCompletionOfDocumentsRouteData()
|
||||
.push(context);
|
||||
} else if (value ==
|
||||
TenderSubmissionMode.partnership.value) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((
|
||||
timeStamp,
|
||||
) {
|
||||
showSelectMeetingTimeDialog(
|
||||
context: context,
|
||||
onConfirm: (String value) {
|
||||
const CompletionOfDocumentsRouteData()
|
||||
.push(context);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
@@ -199,10 +214,27 @@ class TenderDetailActions extends StatelessWidget {
|
||||
builder: (context) {
|
||||
return SelectSubmissionBottomSheet(
|
||||
onConfirm: (String value) {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: value,
|
||||
);
|
||||
if (value ==
|
||||
TenderSubmissionMode.selfApply.value) {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: value,
|
||||
);
|
||||
} else if (value ==
|
||||
TenderSubmissionMode.partnership.value) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return SelectMeetingTimeBottomSheet(
|
||||
onConfirm: (String value) {
|
||||
const CompletionOfDocumentsRouteData()
|
||||
.push(context);
|
||||
},
|
||||
isDialog: false,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user