Refactor completion of documents routing and UI components
- Removed unused mobile route for completion of documents. - Updated app routes to reflect the removal of the mobile route. - Enhanced the desktop and mobile pages for completion of documents with improved layout and added TabletDesktopAppbar. - Introduced meeting time handling in TenderDetailActions, integrating new bottom sheet and dialog components for better user interaction. - Added meeting time state management in TenderDetailViewModel. - Cleaned up deprecated files related to meeting time selection.
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:go_router/go_router.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:tm_app/views/completion_of_documents/pages/complectopn_of_documents_screen.dart';
|
import 'package:tm_app/views/completion_of_documents/pages/complectopn_of_documents_screen.dart';
|
||||||
import 'package:tm_app/views/completion_of_documents/pages/m_completion_of_documents_page.dart';
|
|
||||||
import 'package:tm_app/views/detail/pages/detail_screen.dart';
|
import 'package:tm_app/views/detail/pages/detail_screen.dart';
|
||||||
import 'package:tm_app/views/forget_password_create/pages/forgot_password_create_screen.dart';
|
import 'package:tm_app/views/forget_password_create/pages/forgot_password_create_screen.dart';
|
||||||
import 'package:tm_app/views/forget_password_otp/pages/forgot_password_otp_screen.dart';
|
import 'package:tm_app/views/forget_password_otp/pages/forgot_password_otp_screen.dart';
|
||||||
@@ -236,9 +235,7 @@ class FinalCompletionOfDocumentsRouteData extends GoRouteData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<CompletionOfDocumentsRouteData>(
|
@TypedGoRoute<CompletionOfDocumentsRouteData>(path: '/completion_of_documents')
|
||||||
path: '/completion_of_documents',
|
|
||||||
)
|
|
||||||
class CompletionOfDocumentsRouteData extends GoRouteData
|
class CompletionOfDocumentsRouteData extends GoRouteData
|
||||||
with _$CompletionOfDocumentsRouteData {
|
with _$CompletionOfDocumentsRouteData {
|
||||||
const CompletionOfDocumentsRouteData();
|
const CompletionOfDocumentsRouteData();
|
||||||
@@ -246,7 +243,6 @@ class CompletionOfDocumentsRouteData extends GoRouteData
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Widget build(BuildContext context, GoRouterState state) {
|
||||||
return const CompletionOfDocumentsScreen();
|
return const CompletionOfDocumentsScreen();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,20 +256,20 @@ class LikedTendersRouteData extends GoRouteData with _$LikedTendersRouteData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<CompletionOfDocumentsMobileRouteData>(
|
// @TypedGoRoute<CompletionOfDocumentsRouteData>(
|
||||||
path: '/completion-of-documents',
|
// path: '/completion-of-documents',
|
||||||
)
|
// )
|
||||||
class CompletionOfDocumentsMobileRouteData extends GoRouteData
|
// class CompletionOfDocumentsMobileRouteData extends GoRouteData
|
||||||
with _$CompletionOfDocumentsMobileRouteData {
|
// with _$CompletionOfDocumentsMobileRouteData {
|
||||||
const CompletionOfDocumentsMobileRouteData();
|
// const CompletionOfDocumentsMobileRouteData();
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
// Widget build(BuildContext context, GoRouterState state) {
|
||||||
return finalCompletionProvider(
|
// return finalCompletionProvider(
|
||||||
child: const CompletionOfDocumentsMobilePage(),
|
// child: const CompletionOfDocumentsMobilePage(),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@TypedGoRoute<TenderDetailRouteData>(path: '/tender-detail')
|
@TypedGoRoute<TenderDetailRouteData>(path: '/tender-detail')
|
||||||
class TenderDetailRouteData extends GoRouteData with _$TenderDetailRouteData {
|
class TenderDetailRouteData extends GoRouteData with _$TenderDetailRouteData {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ List<RouteBase> get $appRoutes => [
|
|||||||
$finalCompletionOfDocumentsRouteData,
|
$finalCompletionOfDocumentsRouteData,
|
||||||
$completionOfDocumentsRouteData,
|
$completionOfDocumentsRouteData,
|
||||||
$likedTendersRouteData,
|
$likedTendersRouteData,
|
||||||
$completionOfDocumentsMobileRouteData,
|
|
||||||
$tenderDetailRouteData,
|
$tenderDetailRouteData,
|
||||||
$forgotPasswordRouteData,
|
$forgotPasswordRouteData,
|
||||||
$forgotPasswordOtpRouteData,
|
$forgotPasswordOtpRouteData,
|
||||||
@@ -349,33 +348,6 @@ mixin _$LikedTendersRouteData on GoRouteData {
|
|||||||
void replace(BuildContext context) => context.replace(location);
|
void replace(BuildContext context) => context.replace(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteBase get $completionOfDocumentsMobileRouteData => GoRouteData.$route(
|
|
||||||
path: '/completion-of-documents',
|
|
||||||
|
|
||||||
factory: _$CompletionOfDocumentsMobileRouteData._fromState,
|
|
||||||
);
|
|
||||||
|
|
||||||
mixin _$CompletionOfDocumentsMobileRouteData on GoRouteData {
|
|
||||||
static CompletionOfDocumentsMobileRouteData _fromState(GoRouterState state) =>
|
|
||||||
const CompletionOfDocumentsMobileRouteData();
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get location => GoRouteData.$location('/completion-of-documents');
|
|
||||||
|
|
||||||
@override
|
|
||||||
void go(BuildContext context) => context.go(location);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void pushReplacement(BuildContext context) =>
|
|
||||||
context.pushReplacement(location);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void replace(BuildContext context) => context.replace(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
RouteBase get $tenderDetailRouteData => GoRouteData.$route(
|
RouteBase get $tenderDetailRouteData => GoRouteData.$route(
|
||||||
path: '/tender-detail',
|
path: '/tender-detail',
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class TenderDetailViewModel with ChangeNotifier {
|
|||||||
TenderApprovalsData? _tenderApprovalData;
|
TenderApprovalsData? _tenderApprovalData;
|
||||||
bool approvalStatus = false;
|
bool approvalStatus = false;
|
||||||
String _status = '';
|
String _status = '';
|
||||||
|
String _meetingTime = '';
|
||||||
|
|
||||||
bool get isLoading => _isLoading;
|
bool get isLoading => _isLoading;
|
||||||
bool get isSubmitApprovalLoading => _isSubmitApprovalLoading;
|
bool get isSubmitApprovalLoading => _isSubmitApprovalLoading;
|
||||||
@@ -36,6 +37,12 @@ class TenderDetailViewModel with ChangeNotifier {
|
|||||||
TenderData? get tenderDetail => _tenderDetail;
|
TenderData? get tenderDetail => _tenderDetail;
|
||||||
TenderApprovalsData? get tenderApprovalData => _tenderApprovalData;
|
TenderApprovalsData? get tenderApprovalData => _tenderApprovalData;
|
||||||
String get status => _status;
|
String get status => _status;
|
||||||
|
String get meetingTime => _meetingTime;
|
||||||
|
|
||||||
|
set meetingTime(String value) {
|
||||||
|
_meetingTime = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> getTenderDetail({required String id}) async {
|
Future<void> getTenderDetail({required String id}) async {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ 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/completion_of_documents/strings/completion_of_documents_string.dart';
|
||||||
import 'package:tm_app/views/shared/base_button.dart';
|
import 'package:tm_app/views/shared/base_button.dart';
|
||||||
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
|
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
|
||||||
|
import 'package:tm_app/views/shared/tablet_desktop_appbar.dart'
|
||||||
|
show TabletDesktopAppbar;
|
||||||
|
|
||||||
class CompletionOfDocumentsDesktopPage extends StatelessWidget {
|
class CompletionOfDocumentsDesktopPage extends StatelessWidget {
|
||||||
const CompletionOfDocumentsDesktopPage({super.key});
|
const CompletionOfDocumentsDesktopPage({super.key});
|
||||||
@@ -17,36 +19,24 @@ class CompletionOfDocumentsDesktopPage extends StatelessWidget {
|
|||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
const DesktopNavigationWidget(currentIndex: 0),
|
const DesktopNavigationWidget(currentIndex: 0),
|
||||||
SizedBox(
|
Expanded(
|
||||||
width: 760,
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
child: SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: Padding(
|
width: 760,
|
||||||
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
|
child: Center(
|
||||||
child: Expanded(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
SizedBox(height: 40.0.h()),
|
||||||
children: [
|
const TabletDesktopAppbar(
|
||||||
SvgPicture.asset(
|
title:
|
||||||
AssetsManager.arrowLeft,
|
|
||||||
width: 24.0.w(),
|
|
||||||
height: 24.0.h(),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8.0.w()),
|
|
||||||
Text(
|
|
||||||
CompletionOfDocumentsStrings
|
CompletionOfDocumentsStrings
|
||||||
.completionOfDocuments,
|
.completionOfDocuments,
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.grey70,
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
|
|
||||||
_deadlineContainer(),
|
_deadlineContainer(),
|
||||||
@@ -78,6 +68,7 @@ class CompletionOfDocumentsDesktopPage extends StatelessWidget {
|
|||||||
textColor: AppColors.textBlue,
|
textColor: AppColors.textBlue,
|
||||||
backgroundColor: AppColors.primary30,
|
backgroundColor: AppColors.primary30,
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 24.0.h()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ 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/completion_of_documents/strings/completion_of_documents_string.dart';
|
||||||
import 'package:tm_app/views/shared/base_button.dart';
|
import 'package:tm_app/views/shared/base_button.dart';
|
||||||
|
|
||||||
|
import '../../shared/tender_app_bar.dart';
|
||||||
|
|
||||||
class CompletionOfDocumentsMobilePage extends StatelessWidget {
|
class CompletionOfDocumentsMobilePage extends StatelessWidget {
|
||||||
const CompletionOfDocumentsMobilePage({super.key});
|
const CompletionOfDocumentsMobilePage({super.key});
|
||||||
|
|
||||||
@@ -13,10 +15,10 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
// appBar: appBar(
|
appBar: appBar(
|
||||||
// context: context,
|
context: context,
|
||||||
// title: CompletionOfDocumentsStrings.completionOfDocuments,
|
title: CompletionOfDocumentsStrings.completionOfDocuments,
|
||||||
// ),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
@@ -26,26 +28,6 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
AssetsManager.arrowLeft,
|
|
||||||
width: 24.0.w(),
|
|
||||||
height: 24.0.h(),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8.0.w()),
|
|
||||||
Text(
|
|
||||||
CompletionOfDocumentsStrings.completionOfDocuments,
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.grey70,
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 24.0.h()),
|
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 24.0.h(),
|
height: 24.0.h(),
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
|
|||||||
TenderDetailActions(
|
TenderDetailActions(
|
||||||
isScreenBig: true,
|
isScreenBig: true,
|
||||||
detail: detail,
|
detail: detail,
|
||||||
|
viewModel: viewModel,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -114,7 +114,11 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
|||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
TenderDetailCard(detail: detail),
|
TenderDetailCard(detail: detail),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
TenderDetailActions(isScreenBig: false, detail: detail),
|
TenderDetailActions(
|
||||||
|
isScreenBig: false,
|
||||||
|
detail: detail,
|
||||||
|
viewModel: viewModel,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -125,7 +125,11 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
|
|||||||
SizedBox(height: 28.0.h()),
|
SizedBox(height: 28.0.h()),
|
||||||
TenderDetailCard(detail: detail),
|
TenderDetailCard(detail: detail),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
TenderDetailActions(isScreenBig: true, detail: detail),
|
TenderDetailActions(
|
||||||
|
isScreenBig: true,
|
||||||
|
detail: detail,
|
||||||
|
viewModel: viewModel,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -37,4 +37,6 @@ class TenderDetailsStrings {
|
|||||||
static const String pleaseReplyBy = 'If you’d like to join, Please Reply by ';
|
static const String pleaseReplyBy = 'If you’d like to join, Please Reply by ';
|
||||||
static const String lastDayToPrepareProposal =
|
static const String lastDayToPrepareProposal =
|
||||||
'Last day to prepare proposal is ';
|
'Last day to prepare proposal is ';
|
||||||
|
static const String meetingTimeSuccessfullySet =
|
||||||
|
'meeting time successfully set';
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-15
@@ -1,21 +1,20 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:tm_app/core/routes/app_routes.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:tm_app/core/theme/colors.dart';
|
|
||||||
import 'package:tm_app/core/utils/size_config.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 {
|
import '../../../core/routes/app_routes.dart';
|
||||||
const SelectMeetingTimeBottomSheet({required this.onConfirm, required this.isDialog, super.key});
|
import '../../../core/theme/colors.dart';
|
||||||
|
import '../strings/tender_details_strings.dart';
|
||||||
|
|
||||||
|
class MeetingTimeBottomSheet extends StatefulWidget {
|
||||||
|
const MeetingTimeBottomSheet({required this.onConfirm, super.key});
|
||||||
final ValueChanged<String> onConfirm;
|
final ValueChanged<String> onConfirm;
|
||||||
final bool isDialog;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SelectMeetingTimeBottomSheet> createState() =>
|
State<MeetingTimeBottomSheet> createState() => _MeetingTimeBottomSheetState();
|
||||||
_SelectMeetingTimeBottomSheetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SelectMeetingTimeBottomSheetState
|
class _MeetingTimeBottomSheetState extends State<MeetingTimeBottomSheet> {
|
||||||
extends State<SelectMeetingTimeBottomSheet> {
|
|
||||||
int selectedType = 0;
|
int selectedType = 0;
|
||||||
late String type = '';
|
late String type = '';
|
||||||
|
|
||||||
@@ -26,7 +25,6 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
{'title': 'Sun 2025-06-18', 'value': 'mode4', 'time': '16:00'},
|
{'title': 'Sun 2025-06-18', 'value': 'mode4', 'time': '16:00'},
|
||||||
{'title': 'Sun 2025-06-19', 'value': 'mode5', 'time': '18:00'},
|
{'title': 'Sun 2025-06-19', 'value': 'mode5', 'time': '18:00'},
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return Wrap(
|
||||||
@@ -36,7 +34,7 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()),
|
padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.backgroundColor,
|
color: AppColors.backgroundColor,
|
||||||
borderRadius: widget.isDialog ? const BorderRadius.all(Radius.circular(16.0)) : const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(16.0),
|
topLeft: Radius.circular(16.0),
|
||||||
topRight: Radius.circular(16.0),
|
topRight: Radius.circular(16.0),
|
||||||
),
|
),
|
||||||
@@ -77,8 +75,9 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
SizedBox(height: 8.0.h()),
|
SizedBox(height: 8.0.h()),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
const CompletionOfDocumentsMobileRouteData().push(context);
|
widget.onConfirm(type);
|
||||||
//context.pop();
|
context.pop();
|
||||||
|
const CompletionOfDocumentsRouteData().push(context);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -118,6 +117,8 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
color: isSelected ? AppColors.mainBlue : AppColors.grey40,
|
color: isSelected ? AppColors.mainBlue : AppColors.grey40,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@@ -144,7 +145,8 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: isSelected ? AppColors.mainBlue : Colors.transparent,
|
color:
|
||||||
|
isSelected ? AppColors.mainBlue : Colors.transparent,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -176,6 +178,7 @@ class _SelectMeetingTimeBottomSheetState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.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 MeetingTimeDialog extends StatefulWidget {
|
||||||
|
const MeetingTimeDialog({required this.onConfirm, super.key});
|
||||||
|
final ValueChanged<String> onConfirm;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MeetingTimeDialog> createState() => _MeetingTimeDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MeetingTimeDialogState extends State<MeetingTimeDialog> {
|
||||||
|
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 Dialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide.none,
|
||||||
|
),
|
||||||
|
|
||||||
|
insetPadding: const EdgeInsets.symmetric(horizontal: 150),
|
||||||
|
child: 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: const BorderRadius.all(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()),
|
||||||
|
Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
widget.onConfirm(type);
|
||||||
|
context.pop();
|
||||||
|
const CompletionOfDocumentsRouteData().push(context);
|
||||||
|
},
|
||||||
|
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: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
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: 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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
time,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
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);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -3,30 +3,38 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:tm_app/core/theme/colors.dart';
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
import 'package:tm_app/core/utils/size_config.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/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/meeting_time_bottom_sheet.dart';
|
||||||
import 'package:tm_app/views/detail/widgets/show_select_meeting_time_bottom_sheet.dart';
|
import 'package:tm_app/views/detail/widgets/meeting_time_dialog.dart';
|
||||||
import 'package:tm_app/views/shared/base_button.dart';
|
import 'package:tm_app/views/shared/base_button.dart';
|
||||||
import 'package:tm_app/views/shared/select_submission_bottom_sheet.dart';
|
import 'package:tm_app/views/shared/select_submission_bottom_sheet.dart';
|
||||||
|
|
||||||
import '../../../core/constants/tender_approval_status.dart';
|
import '../../../core/constants/tender_approval_status.dart';
|
||||||
import '../../../core/constants/tender_submision_mode.dart';
|
import '../../../core/constants/tender_submision_mode.dart';
|
||||||
import '../../../core/routes/app_routes.dart';
|
import '../../../core/routes/app_routes.dart';
|
||||||
|
import '../../../core/utils/app_toast.dart';
|
||||||
import '../../../data/services/model/tender_data/tender_data.dart';
|
import '../../../data/services/model/tender_data/tender_data.dart';
|
||||||
import '../../shared/select_submission_dialog.dart';
|
import '../../shared/select_submission_dialog.dart';
|
||||||
import '../strings/tender_details_strings.dart';
|
import '../strings/tender_details_strings.dart';
|
||||||
|
|
||||||
class TenderDetailActions extends StatelessWidget {
|
class TenderDetailActions extends StatefulWidget {
|
||||||
final bool isScreenBig;
|
final bool isScreenBig;
|
||||||
final TenderData detail;
|
final TenderData detail;
|
||||||
|
final TenderDetailViewModel viewModel;
|
||||||
const TenderDetailActions({
|
const TenderDetailActions({
|
||||||
required this.isScreenBig,
|
required this.isScreenBig,
|
||||||
required this.detail,
|
required this.detail,
|
||||||
|
required this.viewModel,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<TenderDetailActions> createState() => _TenderDetailActionsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TenderDetailActionsState extends State<TenderDetailActions> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return isScreenBig
|
return widget.isScreenBig
|
||||||
? _webActions()
|
? _webActions()
|
||||||
: Column(
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -60,25 +68,34 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
onConfirm: (String value) {
|
onConfirm: (String value) {
|
||||||
if (value ==
|
if (value ==
|
||||||
TenderSubmissionMode.selfApply.value) {
|
TenderSubmissionMode.selfApply.value) {
|
||||||
viewModel.submitTenderApproval(
|
// viewModel.submitTenderApproval(
|
||||||
tenderId: detail.id!,
|
// tenderId: widget.detail.id!,
|
||||||
submissionMode: value,
|
// submissionMode: value,
|
||||||
|
// );
|
||||||
|
|
||||||
|
const CompletionOfDocumentsRouteData().push(
|
||||||
|
context,
|
||||||
);
|
);
|
||||||
} else if (value ==
|
} else if (value ==
|
||||||
TenderSubmissionMode.partnership.value) {
|
TenderSubmissionMode.partnership.value) {
|
||||||
Future.delayed(Duration.zero, () {
|
Future.delayed(Duration.zero, () {
|
||||||
showDialog(
|
if (context.mounted) {
|
||||||
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
|
||||||
return SelectMeetingTimeBottomSheet(
|
builder: (_) {
|
||||||
onConfirm: (String value) {
|
return MeetingTimeBottomSheet(
|
||||||
const CompletionOfDocumentsRouteData()
|
onConfirm: (value) {
|
||||||
.push(context);
|
AppToast.success(
|
||||||
},
|
context,
|
||||||
isDialog: false,
|
TenderDetailsStrings
|
||||||
|
.meetingTimeSuccessfullySet,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -112,7 +129,7 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
viewModel.rejectTenderApproval(
|
viewModel.rejectTenderApproval(
|
||||||
tenderId: detail.id!,
|
tenderId: widget.detail.id!,
|
||||||
submissionMode: TenderSubmissionMode.selfApply.value,
|
submissionMode: TenderSubmissionMode.selfApply.value,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -148,7 +165,7 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
viewModel.rejectTenderApproval(
|
viewModel.rejectTenderApproval(
|
||||||
tenderId: detail.id!,
|
tenderId: widget.detail.id!,
|
||||||
submissionMode: TenderSubmissionMode.selfApply.value,
|
submissionMode: TenderSubmissionMode.selfApply.value,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -177,7 +194,7 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
if (viewModel.status ==
|
if (viewModel.status ==
|
||||||
TenderApprovalStatus.submitted.value) {
|
TenderApprovalStatus.submitted.value) {
|
||||||
viewModel.submitTenderApproval(
|
viewModel.submitTenderApproval(
|
||||||
tenderId: detail.id!,
|
tenderId: widget.detail.id!,
|
||||||
submissionMode: TenderSubmissionMode.selfApply.value,
|
submissionMode: TenderSubmissionMode.selfApply.value,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -189,20 +206,29 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
onConfirm: (String value) {
|
onConfirm: (String value) {
|
||||||
if (value ==
|
if (value ==
|
||||||
TenderSubmissionMode.selfApply.value) {
|
TenderSubmissionMode.selfApply.value) {
|
||||||
|
if (context.mounted) {
|
||||||
const FinalCompletionOfDocumentsRouteData()
|
const FinalCompletionOfDocumentsRouteData()
|
||||||
.push(context);
|
.push(context);
|
||||||
|
}
|
||||||
} else if (value ==
|
} else if (value ==
|
||||||
TenderSubmissionMode.partnership.value) {
|
TenderSubmissionMode.partnership.value) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((
|
Future.delayed(Duration.zero, () {
|
||||||
timeStamp,
|
if (context.mounted) {
|
||||||
) {
|
showDialog(
|
||||||
showSelectMeetingTimeDialog(
|
|
||||||
context: context,
|
context: context,
|
||||||
onConfirm: (String value) {
|
builder: (context) {
|
||||||
const CompletionOfDocumentsRouteData()
|
return MeetingTimeDialog(
|
||||||
.push(context);
|
onConfirm: (value) {
|
||||||
|
AppToast.success(
|
||||||
|
context,
|
||||||
|
TenderDetailsStrings
|
||||||
|
.meetingTimeSuccessfullySet,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -216,24 +242,38 @@ class TenderDetailActions extends StatelessWidget {
|
|||||||
onConfirm: (String value) {
|
onConfirm: (String value) {
|
||||||
if (value ==
|
if (value ==
|
||||||
TenderSubmissionMode.selfApply.value) {
|
TenderSubmissionMode.selfApply.value) {
|
||||||
viewModel.submitTenderApproval(
|
// viewModel.submitTenderApproval(
|
||||||
tenderId: detail.id!,
|
// tenderId: widget.detail.id!,
|
||||||
submissionMode: value,
|
// submissionMode: value,
|
||||||
);
|
// );
|
||||||
|
if (context.mounted) {
|
||||||
|
const FinalCompletionOfDocumentsRouteData()
|
||||||
|
.push(context);
|
||||||
|
}
|
||||||
} else if (value ==
|
} else if (value ==
|
||||||
TenderSubmissionMode.partnership.value) {
|
TenderSubmissionMode.partnership.value) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectMeetingTimeBottomSheet(
|
return MeetingTimeBottomSheet(
|
||||||
onConfirm: (String value) {
|
onConfirm: (value) {
|
||||||
const CompletionOfDocumentsRouteData()
|
AppToast.success(
|
||||||
.push(context);
|
context,
|
||||||
},
|
TenderDetailsStrings
|
||||||
isDialog: false,
|
.meetingTimeSuccessfullySet,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
// return MeetingTimeDialog(
|
||||||
|
// onConfirm: (String value) {
|
||||||
|
// if (context.mounted) {
|
||||||
|
// const CompletionOfDocumentsRouteData()
|
||||||
|
// .push(context);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
+9
-14
@@ -23,18 +23,17 @@ class DesktopFinalCompletionOfDocumentsPage extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Consumer<FinalCompletionOfDocumentsViewModel>(
|
body: Consumer<FinalCompletionOfDocumentsViewModel>(
|
||||||
builder:
|
builder:
|
||||||
(context, viewModel, child) => SafeArea(
|
(context, viewModel, child) => Column(
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
const DesktopNavigationWidget(currentIndex: 1),
|
const DesktopNavigationWidget(currentIndex: 1),
|
||||||
const SizedBox(height: 64.0),
|
const SizedBox(height: 42.0),
|
||||||
SizedBox(
|
|
||||||
width: 740,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SizedBox(
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
child: SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 740,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const TabletDesktopAppbar(
|
const TabletDesktopAppbar(
|
||||||
@@ -59,8 +58,7 @@ class DesktopFinalCompletionOfDocumentsPage extends StatelessWidget {
|
|||||||
backgroundColor: AppColors.primary10,
|
backgroundColor: AppColors.primary10,
|
||||||
textColor: AppColors.mainBlue,
|
textColor: AppColors.mainBlue,
|
||||||
text:
|
text:
|
||||||
FinalCompletionOfDocumentsStrings
|
FinalCompletionOfDocumentsStrings.back,
|
||||||
.back,
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16.0),
|
const SizedBox(width: 16.0),
|
||||||
BaseButton(
|
BaseButton(
|
||||||
@@ -68,8 +66,7 @@ class DesktopFinalCompletionOfDocumentsPage extends StatelessWidget {
|
|||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
width: 176,
|
width: 176,
|
||||||
text:
|
text:
|
||||||
FinalCompletionOfDocumentsStrings
|
FinalCompletionOfDocumentsStrings.next,
|
||||||
.next,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -79,13 +76,11 @@ class DesktopFinalCompletionOfDocumentsPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user