Files
tm_app/lib/views/shared/select_submission_bottom_sheet.dart
amirrezaghabeli de659ca9cf Add clock asset and enhance meeting time dialogs
- Added a new clock icon asset to the AssetsManager.
- Updated MeetingTimeBottomSheet and MeetingTimeDialog to include a close button for better user experience.
- Introduced MeetingTimeSuccessfulRegisteredBottomSheet and MeetingTimeSuccessfulRegisteredDialog for confirming meeting time registration.
- Refactored submission dialogs to improve layout and interaction consistency.
2025-10-27 13:22:51 +03:30

175 lines
5.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:tm_app/core/utils/size_config.dart';
import '../../core/constants/common_strings.dart';
import '../../core/constants/tender_submision_mode.dart';
import '../../core/theme/colors.dart';
class SelectSubmissionBottomSheet extends StatefulWidget {
const SelectSubmissionBottomSheet({required this.onConfirm, super.key});
final ValueChanged<String> onConfirm;
@override
State<SelectSubmissionBottomSheet> createState() =>
_SelectSubmissionBottomSheetState();
}
class _SelectSubmissionBottomSheetState
extends State<SelectSubmissionBottomSheet> {
int selectedType = 0;
String type = TenderSubmissionMode.selfApply.value;
@override
Widget build(BuildContext context) {
return Wrap(
children: [
Container(
width: double.infinity,
// height: 272.0.h(),
padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()),
decoration: BoxDecoration(
color: AppColors.backgroundColor,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
CommonStrings.selectSubmission,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
InkWell(
onTap: () {
context.pop();
},
splashColor: Colors.transparent,
child: Container(
width: 24.0.w(),
height: 24.0.w(),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(color: AppColors.grey60, width: 2.0),
),
alignment: Alignment.center,
child: Icon(
Icons.close,
color: AppColors.grey60,
size: 16.0,
),
),
),
],
),
SizedBox(height: 16.0.h()),
Divider(color: AppColors.grey20),
SizedBox(height: 8.0.h()),
_submissionType(
title: CommonStrings.selfApply,
isSelected: type == TenderSubmissionMode.selfApply.value,
onTap: () {
selectedType = 0;
type = TenderSubmissionMode.selfApply.value;
setState(() {});
},
),
SizedBox(height: 8.0.h()),
_submissionType(
title: CommonStrings.partnership,
isSelected: type == TenderSubmissionMode.partnership.value,
onTap: () {
selectedType = 1;
type = TenderSubmissionMode.partnership.value;
setState(() {});
},
),
SizedBox(height: 8.0.h()),
InkWell(
onTap: () {
widget.onConfirm(type);
context.pop();
},
child: Container(
width: double.infinity,
height: 56.0.h(),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
child: Text(
CommonStrings.confirm,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.mainBlue,
),
),
),
),
],
),
),
],
);
}
Widget _submissionType({
required VoidCallback onTap,
required String title,
required bool isSelected,
}) {
return InkWell(
onTap: onTap,
child: SizedBox(
width: double.infinity,
height: 56.0.h(),
child: Row(
children: [
Container(
width: 20.0.w(),
height: 20.0.w(),
margin: EdgeInsets.symmetric(
horizontal: 10.0.w(),
vertical: 10.0.h(),
),
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: isSelected ? AppColors.mainBlue : AppColors.grey70,
width: 2.0,
),
),
alignment: Alignment.center,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isSelected ? AppColors.mainBlue : Colors.transparent,
),
),
),
Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey80,
),
),
],
),
),
);
}
}