added new design for CompletionOfDocumentsMobilePage and dialog

This commit is contained in:
llsajjad
2025-09-15 16:25:01 +03:30
parent 1a40d67f2e
commit 27f4fb74c9
11 changed files with 615 additions and 26 deletions
@@ -0,0 +1,327 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/views/completion_of_documents/strings/completion_of_documents_string.dart';
import 'package:tm_app/views/shared/base_button.dart';
import 'package:tm_app/views/shared/tender_app_bar.dart';
class CompletionOfDocumentsMobilePage extends StatelessWidget {
const CompletionOfDocumentsMobilePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
appBar: appBar(
context: context,
title: CompletionOfDocumentsStrings.completionOfDocuments,
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 24.0.h(),
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
CompletionOfDocumentsStrings.submissionDeadline,
style: TextStyle(
color: AppColors.textBlue,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
Text(
'2025-06-15',
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
],
),
),
SizedBox(height: 12.0.h()),
Container(
height: 58.0.h(),
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: 12.0.w(),
vertical: 8.0.h(),
),
decoration: BoxDecoration(
border: Border.all(color: AppColors.orange10),
borderRadius: BorderRadius.circular(8),
color: AppColors.orange0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'Match with your profile',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
Spacer(),
Text(
'75%',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.cyanTeal,
fontWeight: FontWeight.w600,
),
),
],
),
SizedBox(height: 4.0.h()),
Row(
children: [
Expanded(
child: LinearProgressIndicator(
value: 0.75,
backgroundColor: Color(0xFFE0E0E0),
color: AppColors.cyanTeal,
minHeight: 6,
borderRadius: BorderRadius.circular(10),
),
),
],
),
],
),
),
SizedBox(height: 16.0.h()),
_docCard(
title: 'Company Registration Certificate',
subtitle: 'Legal document proving business registration',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary20,
),
_docCard(
title: 'Tax Compliance Certificate',
subtitle: 'Proof of tax registration and compliance',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary30,
),
_docCard(
title: 'Technical Proposal',
subtitle: 'Detailed technical solution for the tender',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Self apply',
tagColor: AppColors.green30,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.green20,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Partnership',
tagColor: AppColors.purple,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.purpleLight,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
borderSideColor: AppColors.red10,
),
SizedBox(height: 16.0.h()),
Text(
CompletionOfDocumentsStrings.setDeadline,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8.0.h()),
Container(
height: 48.0.h(),
padding: EdgeInsets.symmetric(horizontal: 12.0.w()),
decoration: BoxDecoration(
border: Border.all(color: AppColors.grey40),
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'2025/04/10',
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w700,
color: AppColors.grey60,
),
),
SvgPicture.asset(
AssetsManager.calendar,
height: 24.0.h(),
width: 24.0.w(),
),
],
),
),
SizedBox(height: 16.0.h()),
Container(
padding: EdgeInsets.all(12),
height: 100.0.h(),
decoration: BoxDecoration(
border: Border.all(color: AppColors.borderColor),
borderRadius: BorderRadius.circular(8),
color: AppColors.grey0,
),
child: TextField(
maxLines: null,
decoration: InputDecoration.collapsed(
hintText: CompletionOfDocumentsStrings.note,
),
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey60,
fontWeight: FontWeight.w400,
),
),
),
SizedBox(height: 24.0.h()),
BaseButton(
isEnabled: true,
onPressed: () {},
text: CompletionOfDocumentsStrings.submitForCompletion,
textColor: AppColors.textBlue,
backgroundColor: AppColors.primary30,
),
],
),
),
);
}
Widget _docCard({
required String title,
required String subtitle,
required String status,
required Color statusColor,
required Color backgroundColor,
required Color borderSideColor,
required Color statusBackgroundColor,
String? tag,
Color? tagColor,
Color? tagBackgroundColor,
}) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(bottom: 12.0.h()),
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: backgroundColor,
border: Border(
left: BorderSide(color: borderSideColor, width: 2.0.w()),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
if (tag != null) ...[
Spacer(),
Container(
margin: EdgeInsets.only(right: 8),
height: 32.0.h(),
width: 91.0.w(),
decoration: BoxDecoration(
color: tagBackgroundColor,
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
tag,
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: tagColor,
),
),
),
),
],
if (tag == null) Spacer(),
Container(
height: 32.0.h(),
width: 91.0.w(),
decoration: BoxDecoration(
color: statusBackgroundColor,
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
status,
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: statusColor,
),
),
),
),
],
),
SizedBox(height: 8.0.h()),
Text(
title,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
SizedBox(height: 4.0.h()),
Text(
subtitle,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey,
fontWeight: FontWeight.w400,
),
),
],
),
);
}
}
@@ -0,0 +1,10 @@
class CompletionOfDocumentsStrings {
CompletionOfDocumentsStrings._();
static const String completionOfDocuments = 'Completion of documents';
static const String submissionDeadline = 'Submission deadline:';
static const String setDeadline =
'Set Deadline for Completion of documents :';
static const String note = 'Note:';
static const String submitForCompletion = 'Submit for completion';
}
@@ -31,4 +31,6 @@ class TenderDetailsStrings {
static const String tenderUnsubmittedSuccessfully =
'tender unsubmitted successfully!';
static const String tenderNoData = 'No tender details available';
static const String meetingTime = 'Meeting Time';
static const String apply = 'Apply';
}
@@ -0,0 +1,180 @@
import 'package:flutter/material.dart';
import 'package:tm_app/core/routes/app_routes.dart';
import 'package:tm_app/core/theme/colors.dart';
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});
final ValueChanged<String> onConfirm;
@override
State<SelectMeetingTimeBottomSheet> createState() =>
_SelectMeetingTimeBottomSheetState();
}
class _SelectMeetingTimeBottomSheetState
extends State<SelectMeetingTimeBottomSheet> {
int selectedType = 0;
late String type = '';
final List<Map<String, String>> times = [
{'title': 'Sun 2025-06-15', 'value': 'mode1', 'time': '10:00'},
{'title': 'Sun 2025-06-16', 'value': 'mode2', 'time': '12:00'},
{'title': 'Sun 2025-06-17', 'value': 'mode3', 'time': '14:00'},
{'title': 'Sun 2025-06-18', 'value': 'mode4', 'time': '16:00'},
{'title': 'Sun 2025-06-19', 'value': 'mode5', 'time': '18:00'},
];
@override
Widget build(BuildContext context) {
return Wrap(
children: [
Container(
width: double.infinity,
padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()),
decoration: BoxDecoration(
color: AppColors.backgroundColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
),
),
child: Column(
children: [
Text(
TenderDetailsStrings.meetingTime,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
SizedBox(height: 15.0.h()),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: times.length,
itemBuilder: (context, index) {
final item = times[index];
return Padding(
padding: EdgeInsets.only(bottom: 8.0.h()),
child: _submissionType(
title: item['title']!,
time: item['time']!,
isSelected: type == item['value'],
onTap: () {
selectedType = index;
type = item['value']!;
setState(() {});
},
),
);
},
),
SizedBox(height: 8.0.h()),
SizedBox(height: 8.0.h()),
InkWell(
onTap: () {
CompletionOfDocumentsMobileRouteData().push(context);
//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(
TenderDetailsStrings.apply,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.mainBlue,
),
),
),
),
],
),
),
],
);
}
Widget _submissionType({
required VoidCallback onTap,
required String title,
required String time,
required bool isSelected,
}) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
border: Border.all(
color: isSelected ? AppColors.mainBlue : AppColors.grey40,
),
),
child: InkWell(
onTap: onTap,
child: SizedBox(
width: double.infinity,
height: 40.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: 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,
),
),
),
Expanded(
child: Row(
children: [
Text(
title,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.grey80,
),
),
Spacer(),
Text(
time,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.grey80,
),
),
SizedBox(width: 10.0.w()),
],
),
),
],
),
),
),
);
}
}
@@ -3,6 +3,7 @@ import 'package:provider/provider.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/detail/widgets/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';
@@ -49,24 +50,29 @@ class TenderDetailActions extends StatelessWidget {
backgroundColor: AppColors.primary30,
textColor: AppColors.mainBlue,
onPressed: () {
if (viewModel.status ==
TenderApprovalStatus.submitted.value) {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode:
TenderSubmissionMode.selfApply.value,
);
} else {
{
showModalBottomSheet(
isDismissible: true,
context: context,
builder: (context) {
builder: (bottomSheetContext) {
return SelectSubmissionBottomSheet(
onConfirm: (value) {
viewModel.submitTenderApproval(
tenderId: detail.id!,
submissionMode: value,
);
// viewModel.submitTenderApproval(
// tenderId: detail.id!,
// submissionMode: value,
// );
Future.delayed(Duration.zero, () {
showModalBottomSheet(
isDismissible: true,
// ignore: use_build_context_synchronously
context: context,
builder: (context) {
return SelectMeetingTimeBottomSheet(
onConfirm: (meetingTime) {},
);
},
);
});
},
);
},