refactors on codes
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
import 'package:tm_app/core/utils/result.dart';
|
import 'package:tm_app/core/utils/result.dart';
|
||||||
import 'package:tm_app/data/repositories/your_tenders_repository.dart';
|
import 'package:tm_app/data/repositories/your_tenders_repository.dart';
|
||||||
import 'package:tm_app/data/services/model/liked_tenders_response/liked_tenders_response.dart';
|
import 'package:tm_app/data/services/model/liked_tenders_response/liked_tenders_response.dart';
|
||||||
import 'package:tm_app/data/services/model/tender_approvals_response/tender_approvals_response.dart';
|
import 'package:tm_app/data/services/model/tender_approvals_response/tender_approvals_response.dart';
|
||||||
import 'package:tm_app/views/your_tenders/strings/your_tenders_strings.dart';
|
import 'package:tm_app/views/your_tenders/strings/your_tenders_strings.dart';
|
||||||
|
|
||||||
|
import '../core/constants/assets.dart';
|
||||||
import '../core/constants/tender_approval_status.dart';
|
import '../core/constants/tender_approval_status.dart';
|
||||||
import '../core/constants/tender_feedback.dart';
|
import '../core/constants/tender_feedback.dart';
|
||||||
import '../data/services/model/request_models/get_tenders_request_model/get_tenders_request_model.dart';
|
import '../data/services/model/request_models/get_tenders_request_model/get_tenders_request_model.dart';
|
||||||
@@ -322,4 +324,59 @@ class YourTendersViewModel with ChangeNotifier {
|
|||||||
|
|
||||||
await callWithFilter();
|
await callWithFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color getBackGroundColorByStatus(String status) {
|
||||||
|
if (status == TenderFeedback.liked.value ||
|
||||||
|
status == TenderApprovalStatus.submitted.value) {
|
||||||
|
return AppColors.green0;
|
||||||
|
} else if (status == TenderFeedback.disliked.value ||
|
||||||
|
status == TenderApprovalStatus.rejected.value) {
|
||||||
|
return AppColors.red0;
|
||||||
|
}
|
||||||
|
return AppColors.grey0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color getBorderColorByStatus(String status) {
|
||||||
|
if (status == TenderFeedback.liked.value ||
|
||||||
|
status == TenderApprovalStatus.submitted.value) {
|
||||||
|
return AppColors.green10;
|
||||||
|
} else if (status == TenderFeedback.disliked.value ||
|
||||||
|
status == TenderApprovalStatus.rejected.value) {
|
||||||
|
return AppColors.red10;
|
||||||
|
}
|
||||||
|
return AppColors.grey30;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color getStatusCardColorByStatus(String status) {
|
||||||
|
if (status == TenderFeedback.liked.value ||
|
||||||
|
status == TenderApprovalStatus.submitted.value) {
|
||||||
|
return AppColors.green20;
|
||||||
|
} else if (status == TenderFeedback.disliked.value ||
|
||||||
|
status == TenderApprovalStatus.rejected.value) {
|
||||||
|
return AppColors.red10;
|
||||||
|
}
|
||||||
|
return AppColors.grey0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color getStatusTextColorByStatus(String status) {
|
||||||
|
if (status == TenderFeedback.liked.value ||
|
||||||
|
status == TenderApprovalStatus.submitted.value) {
|
||||||
|
return AppColors.green30;
|
||||||
|
} else if (status == TenderFeedback.disliked.value ||
|
||||||
|
status == TenderApprovalStatus.rejected.value) {
|
||||||
|
return AppColors.red20;
|
||||||
|
}
|
||||||
|
return AppColors.grey60;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? getStatusIconByStatus(String status) {
|
||||||
|
if (status == TenderFeedback.liked.value ||
|
||||||
|
status == TenderApprovalStatus.submitted.value) {
|
||||||
|
return AssetsManager.tickCircle;
|
||||||
|
} else if (status == TenderFeedback.disliked.value ||
|
||||||
|
status == TenderApprovalStatus.rejected.value) {
|
||||||
|
return AssetsManager.closeCircle;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:tm_app/views/detail/widgets/tender_detail_header.dart';
|
|||||||
import '../../../core/constants/tender_approval_status.dart';
|
import '../../../core/constants/tender_approval_status.dart';
|
||||||
import '../../../core/utils/app_toast.dart';
|
import '../../../core/utils/app_toast.dart';
|
||||||
import '../../shared/desktop_navigation_widget.dart';
|
import '../../shared/desktop_navigation_widget.dart';
|
||||||
|
import '../../shared/tablet_desktop_appbar.dart';
|
||||||
import '../strings/tender_details_strings.dart';
|
import '../strings/tender_details_strings.dart';
|
||||||
|
|
||||||
class TenderDetailDesktopPage extends StatefulWidget {
|
class TenderDetailDesktopPage extends StatefulWidget {
|
||||||
@@ -118,6 +119,10 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
const TabletDesktopAppbar(
|
||||||
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
|
),
|
||||||
|
SizedBox(height: 32.0.h()),
|
||||||
TenderDetailHeader(
|
TenderDetailHeader(
|
||||||
isScreenBig: true,
|
isScreenBig: true,
|
||||||
detail: detail,
|
detail: detail,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:tm_app/views/shared/tablet_navigation_widget.dart';
|
|||||||
|
|
||||||
import '../../../core/constants/tender_approval_status.dart';
|
import '../../../core/constants/tender_approval_status.dart';
|
||||||
import '../../../core/utils/app_toast.dart';
|
import '../../../core/utils/app_toast.dart';
|
||||||
|
import '../../shared/tablet_desktop_appbar.dart';
|
||||||
import '../../shared/tender_app_bar.dart';
|
import '../../shared/tender_app_bar.dart';
|
||||||
import '../strings/tender_details_strings.dart';
|
import '../strings/tender_details_strings.dart';
|
||||||
|
|
||||||
@@ -125,6 +126,10 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
const TabletDesktopAppbar(
|
||||||
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
|
),
|
||||||
|
SizedBox(height: 28.0.h()),
|
||||||
TenderDetailHeader(isScreenBig: true, detail: detail),
|
TenderDetailHeader(isScreenBig: true, detail: detail),
|
||||||
SizedBox(height: 28.0.h()),
|
SizedBox(height: 28.0.h()),
|
||||||
TenderDetailCard(detail: detail),
|
TenderDetailCard(detail: detail),
|
||||||
|
|||||||
+5
-19
@@ -1,7 +1,6 @@
|
|||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/constants/assets.dart';
|
import 'package:tm_app/core/constants/assets.dart';
|
||||||
import 'package:tm_app/core/theme/colors.dart';
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
@@ -11,6 +10,7 @@ import 'package:tm_app/views/final_completion_of_documents/strings/final_complet
|
|||||||
import 'package:tm_app/views/final_completion_of_documents/widgets/comment_box.dart';
|
import 'package:tm_app/views/final_completion_of_documents/widgets/comment_box.dart';
|
||||||
import 'package:tm_app/views/login/widgets/widgets.dart';
|
import 'package:tm_app/views/login/widgets/widgets.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';
|
||||||
|
|
||||||
import '../../shared/main_drop_down.dart';
|
import '../../shared/main_drop_down.dart';
|
||||||
|
|
||||||
@@ -33,27 +33,13 @@ class FinalCompletionOfDocumentsScreen extends StatelessWidget {
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
const TabletDesktopAppbar(
|
||||||
children: [
|
title:
|
||||||
InkWell(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
onTap: () => context.pop(),
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
AssetsManager.arrowLeft,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8.0),
|
|
||||||
Text(
|
|
||||||
FinalCompletionOfDocumentsStrings
|
FinalCompletionOfDocumentsStrings
|
||||||
.completionOfDocuments,
|
.completionOfDocuments,
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 32.0.h()),
|
||||||
|
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
const CommentBox(),
|
const CommentBox(),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
|
|||||||
@@ -4,15 +4,17 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:tm_app/core/constants/assets.dart';
|
import 'package:tm_app/core/constants/assets.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/data/services/model/liked_tender_feedback/liked_tender_feedback.dart';
|
||||||
import 'package:tm_app/data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
import 'package:tm_app/data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
||||||
import 'package:tm_app/view_models/liked_tenders_view_model.dart';
|
import 'package:tm_app/view_models/liked_tenders_view_model.dart';
|
||||||
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_filter_drawer.dart';
|
|
||||||
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_list_item.dart';
|
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_list_item.dart';
|
||||||
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
||||||
|
|
||||||
import '../../../core/utils/app_toast.dart';
|
import '../../../core/utils/app_toast.dart';
|
||||||
import '../../shared/desktop_navigation_widget.dart';
|
import '../../shared/desktop_navigation_widget.dart';
|
||||||
|
import '../../shared/tablet_desktop_appbar.dart';
|
||||||
import '../strings/liked_tenders_strings.dart';
|
import '../strings/liked_tenders_strings.dart';
|
||||||
|
import '../widgets/like_filters_drawer.dart';
|
||||||
|
|
||||||
class LikedTendersDesktopPage extends StatefulWidget {
|
class LikedTendersDesktopPage extends StatefulWidget {
|
||||||
const LikedTendersDesktopPage({super.key});
|
const LikedTendersDesktopPage({super.key});
|
||||||
@@ -24,6 +26,7 @@ class LikedTendersDesktopPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
||||||
late final LikedTendersViewModel viewModel;
|
late final LikedTendersViewModel viewModel;
|
||||||
|
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
viewModel = context.read<LikedTendersViewModel>();
|
viewModel = context.read<LikedTendersViewModel>();
|
||||||
@@ -54,11 +57,24 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
key: scaffoldKey,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
endDrawer: const LikedTendersFilterDrawer(isTablet: false,),
|
endDrawer: const LikeFiltersDrawer(),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
|
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
|
||||||
|
const SizedBox(height: 40),
|
||||||
|
SizedBox(
|
||||||
|
width: 740,
|
||||||
|
child: TabletDesktopAppbar(
|
||||||
|
title: LikedTendersStrings.likedTenders,
|
||||||
|
haveFilter: true,
|
||||||
|
onFilterPressed: () {
|
||||||
|
scaffoldKey.currentState?.openEndDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 740,
|
width: 740,
|
||||||
@@ -90,134 +106,15 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
_likedTendersList(feedback, viewModel),
|
||||||
child: ListView.builder(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 24.0.w(),
|
|
||||||
vertical: 15.0.h(),
|
|
||||||
),
|
|
||||||
itemCount: feedback.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = feedback[index];
|
|
||||||
TenderApprovalsData? approval;
|
|
||||||
bool hasApproval = viewModel
|
|
||||||
.hasTenderApprovalForTender(item.tenderId!);
|
|
||||||
if (hasApproval) {
|
|
||||||
approval = viewModel.getApprovalStatusForTender(
|
|
||||||
item.tenderId!,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
approval = null;
|
|
||||||
}
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 20.0.h()),
|
|
||||||
child: Dismissible(
|
|
||||||
key: ValueKey(item.tenderId ?? index),
|
|
||||||
direction: DismissDirection.endToStart,
|
|
||||||
background: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 20.0.w(),
|
|
||||||
),
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
AssetsManager.trash,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onDismissed: (_) {
|
|
||||||
if (item.tenderId != null) {
|
|
||||||
viewModel.removeTenderById(
|
|
||||||
item.tenderId!,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: LikedListItem(
|
|
||||||
tender: item.tender!,
|
|
||||||
approval: approval,
|
|
||||||
isDesktop: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 10.0.h()),
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
Row(
|
_likedTenersListPageControll(
|
||||||
children: [
|
context,
|
||||||
const Spacer(),
|
totalPages,
|
||||||
Text(
|
viewModel,
|
||||||
LikedTendersStrings.page,
|
currentPage,
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.0.w()),
|
|
||||||
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final selectedPage = await showDialog<int>(
|
|
||||||
context: context,
|
|
||||||
builder:
|
|
||||||
(context) => PageSelectionDialog(
|
|
||||||
totalPages: totalPages,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedPage != null) {
|
|
||||||
await viewModel.jumpToPage(selectedPage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColors.grey30,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'$currentPage',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
SvgPicture.asset(
|
|
||||||
AssetsManager.arrowDownSmall,
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
LikedTendersStrings.of,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'$totalPages',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
SizedBox(height: 30.0.h()),
|
||||||
@@ -232,4 +129,126 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Widget _likedTenersListPageControll(
|
||||||
|
BuildContext context,
|
||||||
|
int totalPages,
|
||||||
|
LikedTendersViewModel viewModel,
|
||||||
|
int currentPage,
|
||||||
|
) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final selectedPage = await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => PageSelectionDialog(totalPages: totalPages),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedPage != null) {
|
||||||
|
await viewModel.jumpToPage(selectedPage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.grey30, width: 1),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'$currentPage',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
SvgPicture.asset(AssetsManager.arrowDownSmall),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.of,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'$totalPages',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _likedTendersList(
|
||||||
|
List<LikedTenderFeedback> feedback,
|
||||||
|
LikedTendersViewModel viewModel,
|
||||||
|
) {
|
||||||
|
return Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 15.0.h()),
|
||||||
|
itemCount: feedback.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = feedback[index];
|
||||||
|
TenderApprovalsData? approval;
|
||||||
|
bool hasApproval = viewModel.hasTenderApprovalForTender(
|
||||||
|
item.tenderId!,
|
||||||
|
);
|
||||||
|
if (hasApproval) {
|
||||||
|
approval = viewModel.getApprovalStatusForTender(item.tenderId!);
|
||||||
|
} else {
|
||||||
|
approval = null;
|
||||||
|
}
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 20.0.h()),
|
||||||
|
child: Dismissible(
|
||||||
|
key: ValueKey(item.tenderId ?? index),
|
||||||
|
direction: DismissDirection.endToStart,
|
||||||
|
background: Container(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20.0.w()),
|
||||||
|
child: SvgPicture.asset(AssetsManager.trash),
|
||||||
|
),
|
||||||
|
onDismissed: (_) {
|
||||||
|
if (item.tenderId != null) {
|
||||||
|
viewModel.removeTenderById(item.tenderId!);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: LikedListItem(
|
||||||
|
tender: item.tender!,
|
||||||
|
approval: approval,
|
||||||
|
isDesktop: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,16 +5,18 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:tm_app/core/constants/assets.dart';
|
import 'package:tm_app/core/constants/assets.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/data/services/model/liked_tender_feedback/liked_tender_feedback.dart';
|
||||||
import 'package:tm_app/view_models/liked_tenders_view_model.dart';
|
import 'package:tm_app/view_models/liked_tenders_view_model.dart';
|
||||||
import 'package:tm_app/views/liked_tenders/strings/liked_tenders_strings.dart';
|
import 'package:tm_app/views/liked_tenders/strings/liked_tenders_strings.dart';
|
||||||
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_filter_drawer.dart';
|
|
||||||
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_list_item.dart';
|
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_list_item.dart';
|
||||||
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
||||||
import 'package:tm_app/views/shared/tender_app_bar.dart';
|
import 'package:tm_app/views/shared/tender_app_bar.dart';
|
||||||
|
|
||||||
import '../../../core/utils/app_toast.dart';
|
import '../../../core/utils/app_toast.dart';
|
||||||
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
||||||
|
import '../../shared/tablet_desktop_appbar.dart';
|
||||||
import '../../shared/tablet_navigation_widget.dart';
|
import '../../shared/tablet_navigation_widget.dart';
|
||||||
|
import '../widgets/like_filters_bottom_sheet.dart';
|
||||||
|
|
||||||
class LikedTendersTabletPage extends StatefulWidget {
|
class LikedTendersTabletPage extends StatefulWidget {
|
||||||
const LikedTendersTabletPage({super.key});
|
const LikedTendersTabletPage({super.key});
|
||||||
@@ -60,126 +62,33 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar:
|
appBar: tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
|
||||||
// PreferredSize(
|
|
||||||
// preferredSize: const Size.fromHeight(60),
|
|
||||||
// child: AppBar(
|
|
||||||
// backgroundColor: AppColors.backgroundColor,
|
|
||||||
// elevation: 0,
|
|
||||||
// titleSpacing: 0,
|
|
||||||
// leading: IconButton(
|
|
||||||
// icon: SvgPicture.asset(
|
|
||||||
// AssetsManager.arrowLeft,
|
|
||||||
// height: 24.0.w(),
|
|
||||||
// width: 24.0.w(),
|
|
||||||
// ),
|
|
||||||
// onPressed: () => Navigator.pop(context),
|
|
||||||
// ),
|
|
||||||
// title: Text(
|
|
||||||
// LikedTendersStrings.likedTenders,
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: AppColors.grey70,
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// fontSize: 20.0.sp(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// actions: [
|
|
||||||
// IconButton(
|
|
||||||
// icon: SvgPicture.asset(
|
|
||||||
// AssetsManager.filter,
|
|
||||||
// height: 24.0.w(),
|
|
||||||
// width: 24.0.w(),
|
|
||||||
// ),
|
|
||||||
// onPressed: () {
|
|
||||||
// showModalBottomSheet(
|
|
||||||
// context: context,
|
|
||||||
// isScrollControlled: true,
|
|
||||||
// backgroundColor: AppColors.backgroundColor,
|
|
||||||
// shape: const RoundedRectangleBorder(
|
|
||||||
// borderRadius: BorderRadius.vertical(
|
|
||||||
// top: Radius.circular(20),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// constraints: BoxConstraints(
|
|
||||||
// maxWidth: MediaQuery.of(context).size.width,
|
|
||||||
// maxHeight: MediaQuery.of(context).size.height,
|
|
||||||
// ),
|
|
||||||
// builder: (context) {
|
|
||||||
// return SizedBox(
|
|
||||||
// width: double.infinity,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(16.0),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// SizedBox(height: 10.0.h()),
|
|
||||||
// Text(
|
|
||||||
// LikedTendersStrings.filter,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// color: AppColors.grey70,
|
|
||||||
// fontSize: 20.0.sp(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 20.0.h()),
|
|
||||||
// _buildFilterOption('Industry'),
|
|
||||||
// _buildFilterOption('Finance'),
|
|
||||||
// _buildFilterOption('Business'),
|
|
||||||
// _buildFilterOption('IT'),
|
|
||||||
// _buildFilterOption('Software'),
|
|
||||||
// SizedBox(height: 20.0.h()),
|
|
||||||
// BaseButton(
|
|
||||||
// backgroundColor: AppColors.primary2,
|
|
||||||
// borderRadius: 24,
|
|
||||||
// isEnabled: true,
|
|
||||||
// onPressed: () => Navigator.pop(context),
|
|
||||||
// text: 'Apply',
|
|
||||||
// textColor: AppColors.textBlue,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 16.0.w()),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
|
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 720,
|
width: 720,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
AppBar(
|
TabletDesktopAppbar(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
title: LikedTendersStrings.likedTenders,
|
||||||
elevation: 0,
|
haveFilter: true,
|
||||||
titleSpacing: 0,
|
onFilterPressed: () {
|
||||||
scrolledUnderElevation: 0,
|
showModalBottomSheet(
|
||||||
leading: IconButton(
|
context: context,
|
||||||
icon: SvgPicture.asset(
|
isScrollControlled: true,
|
||||||
AssetsManager.arrowLeft,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
height: 24.0.w(),
|
shape: const RoundedRectangleBorder(
|
||||||
width: 24.0.w(),
|
borderRadius: BorderRadius.vertical(
|
||||||
),
|
top: Radius.circular(20),
|
||||||
onPressed: () => Navigator.pop(context),
|
),
|
||||||
),
|
),
|
||||||
title: Text(
|
constraints: BoxConstraints(
|
||||||
LikedTendersStrings.likedTenders,
|
maxWidth: MediaQuery.sizeOf(context).width,
|
||||||
style: TextStyle(
|
maxHeight: MediaQuery.sizeOf(context).height,
|
||||||
color: AppColors.grey70,
|
),
|
||||||
fontWeight: FontWeight.w600,
|
builder: (context) => const LikeFiltersBottomSheet(),
|
||||||
fontSize: 20.0.sp(),
|
);
|
||||||
),
|
},
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
const LikedTendersFilterDrawer(isTablet: true,),
|
|
||||||
SizedBox(width: 16.0.w()),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Consumer<LikedTendersViewModel>(
|
child: Consumer<LikedTendersViewModel>(
|
||||||
@@ -210,144 +119,15 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
_likedTendersList(feedback, viewModel),
|
||||||
child: RefreshIndicator(
|
|
||||||
onRefresh: () async {
|
|
||||||
await viewModel.getLikedTenders(reset: true);
|
|
||||||
},
|
|
||||||
child: ListView.builder(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 24.0.w(),
|
|
||||||
vertical: 15.0.h(),
|
|
||||||
),
|
|
||||||
itemCount: feedback.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = feedback[index];
|
|
||||||
TenderApprovalsData? approval;
|
|
||||||
bool hasApproval = viewModel
|
|
||||||
.hasTenderApprovalForTender(
|
|
||||||
item.tenderId!,
|
|
||||||
);
|
|
||||||
if (hasApproval) {
|
|
||||||
approval = viewModel
|
|
||||||
.getApprovalStatusForTender(
|
|
||||||
item.tenderId!,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
approval = null;
|
|
||||||
}
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 20.0.h()),
|
|
||||||
child: Dismissible(
|
|
||||||
key: ValueKey(item.tenderId ?? index),
|
|
||||||
direction: DismissDirection.endToStart,
|
|
||||||
background: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 20.0.w(),
|
|
||||||
),
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
AssetsManager.trash,
|
|
||||||
width: 32.0.w(),
|
|
||||||
height: 32.0.h(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onDismissed: (_) {
|
|
||||||
if (item.tenderId != null) {
|
|
||||||
viewModel.removeTenderById(
|
|
||||||
item.tenderId!,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: LikedListItem(
|
|
||||||
tender: item.tender!,
|
|
||||||
approval: approval,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 10.0.h()),
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
Row(
|
_likeTendersListPagesControll(
|
||||||
children: [
|
context,
|
||||||
const Spacer(),
|
totalPages,
|
||||||
Text(
|
viewModel,
|
||||||
LikedTendersStrings.page,
|
currentPage,
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.0.w()),
|
|
||||||
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final selectedPage = await showDialog<int>(
|
|
||||||
context: context,
|
|
||||||
builder:
|
|
||||||
(context) => PageSelectionDialog(
|
|
||||||
totalPages: totalPages,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedPage != null) {
|
|
||||||
await viewModel.jumpToPage(selectedPage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColors.grey30,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'$currentPage',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
SvgPicture.asset(
|
|
||||||
AssetsManager.arrowDownSmall,
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
LikedTendersStrings.of,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'$totalPages',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 30.0.w()),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
SizedBox(height: 30.0.h()),
|
||||||
@@ -363,5 +143,127 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
Widget _likeTendersListPagesControll(
|
||||||
|
BuildContext context,
|
||||||
|
int totalPages,
|
||||||
|
LikedTendersViewModel viewModel,
|
||||||
|
int currentPage,
|
||||||
|
) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final selectedPage = await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => PageSelectionDialog(totalPages: totalPages),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedPage != null) {
|
||||||
|
await viewModel.jumpToPage(selectedPage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.grey30, width: 1),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'$currentPage',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
SvgPicture.asset(AssetsManager.arrowDownSmall),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.of,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'$totalPages',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 30.0.w()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _likedTendersList(
|
||||||
|
List<LikedTenderFeedback> feedback,
|
||||||
|
LikedTendersViewModel viewModel,
|
||||||
|
) {
|
||||||
|
return Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 15.0.h()),
|
||||||
|
itemCount: feedback.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = feedback[index];
|
||||||
|
TenderApprovalsData? approval;
|
||||||
|
bool hasApproval = viewModel.hasTenderApprovalForTender(
|
||||||
|
item.tenderId!,
|
||||||
|
);
|
||||||
|
if (hasApproval) {
|
||||||
|
approval = viewModel.getApprovalStatusForTender(item.tenderId!);
|
||||||
|
} else {
|
||||||
|
approval = null;
|
||||||
|
}
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 20.0.h()),
|
||||||
|
child: Dismissible(
|
||||||
|
key: ValueKey(item.tenderId ?? index),
|
||||||
|
direction: DismissDirection.endToStart,
|
||||||
|
background: Container(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20.0.w()),
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
AssetsManager.trash,
|
||||||
|
width: 32.0.w(),
|
||||||
|
height: 32.0.h(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onDismissed: (_) {
|
||||||
|
if (item.tenderId != null) {
|
||||||
|
viewModel.removeTenderById(item.tenderId!);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: LikedListItem(tender: item.tender!, approval: approval),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
|
|
||||||
|
import '../../../core/theme/colors.dart';
|
||||||
|
import '../../shared/base_button.dart';
|
||||||
|
import '../strings/liked_tenders_strings.dart';
|
||||||
|
|
||||||
|
class LikeFiltersBottomSheet extends StatelessWidget {
|
||||||
|
const LikeFiltersBottomSheet({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 10.0.h()),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.filter,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
fontSize: 20.0.sp(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 20.0.h()),
|
||||||
|
_buildFilterOption('Industry'),
|
||||||
|
_buildFilterOption('Finance'),
|
||||||
|
_buildFilterOption('Business'),
|
||||||
|
_buildFilterOption('IT'),
|
||||||
|
_buildFilterOption('Software'),
|
||||||
|
SizedBox(height: 20.0.h()),
|
||||||
|
BaseButton(
|
||||||
|
backgroundColor: AppColors.primary2,
|
||||||
|
borderRadius: 24,
|
||||||
|
isEnabled: true,
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
text: 'Apply',
|
||||||
|
textColor: AppColors.textBlue,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildFilterOption(String title) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
color: AppColors.grey80,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
|
|
||||||
|
import '../../../core/theme/colors.dart';
|
||||||
|
import '../../shared/base_button.dart';
|
||||||
|
import '../strings/liked_tenders_strings.dart';
|
||||||
|
|
||||||
|
class LikeFiltersDrawer extends StatelessWidget {
|
||||||
|
const LikeFiltersDrawer({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Drawer(
|
||||||
|
backgroundColor: AppColors.backgroundColor,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 30.0.h()),
|
||||||
|
Text(
|
||||||
|
LikedTendersStrings.filter,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
fontSize: 20.0.sp(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 20.0.h()),
|
||||||
|
|
||||||
|
_buildFilterOption('Industry'),
|
||||||
|
_buildFilterOption('Finance'),
|
||||||
|
_buildFilterOption('Business'),
|
||||||
|
_buildFilterOption('IT'),
|
||||||
|
_buildFilterOption('Software'),
|
||||||
|
|
||||||
|
const Spacer(),
|
||||||
|
|
||||||
|
BaseButton(
|
||||||
|
backgroundColor: AppColors.primary2,
|
||||||
|
borderRadius: 24,
|
||||||
|
isEnabled: true,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
text: LikedTendersStrings.apply,
|
||||||
|
textColor: AppColors.textBlue,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 20.0.h()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildFilterOption(String title) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
color: AppColors.grey80,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
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/liked_tenders/strings/liked_tenders_strings.dart';
|
|
||||||
|
|
||||||
import '../../shared/base_button.dart';
|
|
||||||
|
|
||||||
class LikedTendersFilterDrawer extends StatelessWidget {
|
|
||||||
const LikedTendersFilterDrawer({required this.isTablet, super.key});
|
|
||||||
|
|
||||||
final bool isTablet;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return isTablet
|
|
||||||
? IconButton(
|
|
||||||
icon: SvgPicture.asset(
|
|
||||||
AssetsManager.filter,
|
|
||||||
height: 24.0.w(),
|
|
||||||
width: 24.0.w(),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: AppColors.backgroundColor,
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
||||||
),
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
maxWidth: MediaQuery.of(context).size.width,
|
|
||||||
maxHeight: MediaQuery.of(context).size.height,
|
|
||||||
),
|
|
||||||
builder: (context) {
|
|
||||||
return SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
Text(
|
|
||||||
LikedTendersStrings.filter,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
fontSize: 20.0.sp(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 20.0.h()),
|
|
||||||
_buildFilterOption('Industry'),
|
|
||||||
_buildFilterOption('Finance'),
|
|
||||||
_buildFilterOption('Business'),
|
|
||||||
_buildFilterOption('IT'),
|
|
||||||
_buildFilterOption('Software'),
|
|
||||||
SizedBox(height: 20.0.h()),
|
|
||||||
BaseButton(
|
|
||||||
backgroundColor: AppColors.primary2,
|
|
||||||
borderRadius: 24,
|
|
||||||
isEnabled: true,
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
text: 'Apply',
|
|
||||||
textColor: AppColors.textBlue,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: Drawer(
|
|
||||||
backgroundColor: AppColors.backgroundColor,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 30.0.h()),
|
|
||||||
Text(
|
|
||||||
LikedTendersStrings.filter,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
fontSize: 20.0.sp(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 20.0.h()),
|
|
||||||
|
|
||||||
_buildFilterOption('Industry'),
|
|
||||||
_buildFilterOption('Finance'),
|
|
||||||
_buildFilterOption('Business'),
|
|
||||||
_buildFilterOption('IT'),
|
|
||||||
_buildFilterOption('Software'),
|
|
||||||
|
|
||||||
const Spacer(),
|
|
||||||
|
|
||||||
BaseButton(
|
|
||||||
backgroundColor: AppColors.primary2,
|
|
||||||
borderRadius: 24,
|
|
||||||
isEnabled: true,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
text: LikedTendersStrings.apply,
|
|
||||||
textColor: AppColors.textBlue,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 20.0.h()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildFilterOption(String title) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
color: AppColors.grey80,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -110,31 +110,7 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 36.0.h()),
|
SizedBox(height: 36.0.h()),
|
||||||
Padding(
|
_themeChangeRow(),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
ProfileStrings.appTheme,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
SvgPicture.asset(AssetsManager.sun),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SizedBox(
|
|
||||||
width: 52.0.w(),
|
|
||||||
height: 32.0.h(),
|
|
||||||
child: const ThemeToggle(),
|
|
||||||
),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SvgPicture.asset(AssetsManager.moon),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
@@ -172,4 +148,32 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _themeChangeRow() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
ProfileStrings.appTheme,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
SvgPicture.asset(AssetsManager.sun),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SizedBox(
|
||||||
|
width: 52.0.w(),
|
||||||
|
height: 32.0.h(),
|
||||||
|
child: const ThemeToggle(),
|
||||||
|
),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SvgPicture.asset(AssetsManager.moon),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,31 +109,7 @@ class _MobileProfilePageState extends State<MobileProfilePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 36.0.h()),
|
SizedBox(height: 36.0.h()),
|
||||||
Padding(
|
_themeChangeRow(),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
ProfileStrings.appTheme,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
SvgPicture.asset(AssetsManager.sun),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SizedBox(
|
|
||||||
width: 52.0.w(),
|
|
||||||
height: 32.0.h(),
|
|
||||||
child: const ThemeToggle(),
|
|
||||||
),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SvgPicture.asset(AssetsManager.moon),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
@@ -166,4 +142,32 @@ class _MobileProfilePageState extends State<MobileProfilePage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _themeChangeRow() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
ProfileStrings.appTheme,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
SvgPicture.asset(AssetsManager.sun),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SizedBox(
|
||||||
|
width: 52.0.w(),
|
||||||
|
height: 32.0.h(),
|
||||||
|
child: const ThemeToggle(),
|
||||||
|
),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SvgPicture.asset(AssetsManager.moon),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,31 +115,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 36.0.h()),
|
SizedBox(height: 36.0.h()),
|
||||||
Padding(
|
_themeChangeRow(),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
ProfileStrings.appTheme,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
SvgPicture.asset(AssetsManager.sun),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SizedBox(
|
|
||||||
width: 52.0.w(),
|
|
||||||
height: 32.0.h(),
|
|
||||||
child: const ThemeToggle(),
|
|
||||||
),
|
|
||||||
SizedBox(width: 12.0.w()),
|
|
||||||
SvgPicture.asset(AssetsManager.moon),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
@@ -176,4 +152,32 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _themeChangeRow() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
ProfileStrings.appTheme,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
SvgPicture.asset(AssetsManager.sun),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SizedBox(
|
||||||
|
width: 52.0.w(),
|
||||||
|
height: 32.0.h(),
|
||||||
|
child: const ThemeToggle(),
|
||||||
|
),
|
||||||
|
SizedBox(width: 12.0.w()),
|
||||||
|
SvgPicture.asset(AssetsManager.moon),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
|
|
||||||
|
import '../../core/constants/assets.dart';
|
||||||
|
import '../../core/theme/colors.dart';
|
||||||
|
|
||||||
|
class TabletDesktopAppbar extends StatelessWidget {
|
||||||
|
const TabletDesktopAppbar({
|
||||||
|
required this.title,
|
||||||
|
this.haveFilter,
|
||||||
|
this.onFilterPressed,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final bool? haveFilter;
|
||||||
|
final VoidCallback? onFilterPressed;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isRtl = Directionality.of(context) == TextDirection.rtl;
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
onTap: () => context.pop(),
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
isRtl ? AssetsManager.arrowRight : AssetsManager.arrowLeft,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8.0.w()),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
if (haveFilter == true)
|
||||||
|
IconButton(
|
||||||
|
icon: SvgPicture.asset(
|
||||||
|
AssetsManager.filter,
|
||||||
|
height: 24.0.w(),
|
||||||
|
width: 24.0.w(),
|
||||||
|
),
|
||||||
|
onPressed: onFilterPressed,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,6 +35,7 @@ class TabletNavigationWidget extends StatelessWidget {
|
|||||||
if (currentIndex == 0) {
|
if (currentIndex == 0) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
context.pop();
|
||||||
Router.neglect(
|
Router.neglect(
|
||||||
context,
|
context,
|
||||||
() => const HomeRouteData().go(context),
|
() => const HomeRouteData().go(context),
|
||||||
@@ -53,6 +54,7 @@ class TabletNavigationWidget extends StatelessWidget {
|
|||||||
if (currentIndex == 1) {
|
if (currentIndex == 1) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
context.pop();
|
||||||
Router.neglect(
|
Router.neglect(
|
||||||
context,
|
context,
|
||||||
() => const TendersRouteData().go(context),
|
() => const TendersRouteData().go(context),
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import 'package:tm_app/core/constants/tender_feedback.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/your_tenders_view_model.dart';
|
import 'package:tm_app/view_models/your_tenders_view_model.dart';
|
||||||
|
import 'package:tm_app/views/shared/tablet_desktop_appbar.dart';
|
||||||
import 'package:tm_app/views/your_tenders/strings/your_tenders_strings.dart';
|
import 'package:tm_app/views/your_tenders/strings/your_tenders_strings.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/filter_button.dart';
|
import 'package:tm_app/views/your_tenders/widgets/filter_button.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/liked_disliked_tenders_list.dart';
|
import 'package:tm_app/views/your_tenders/widgets/liked_disliked_tenders_list.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/tablet_desktop_appbar.dart';
|
|
||||||
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
|
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
|
||||||
|
|
||||||
import '../../shared/desktop_navigation_widget.dart';
|
import '../../shared/desktop_navigation_widget.dart';
|
||||||
@@ -48,7 +48,9 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 64.0.h()),
|
SizedBox(height: 64.0.h()),
|
||||||
const TabletDesktopAppbar(),
|
const TabletDesktopAppbar(
|
||||||
|
title: YourTendersStrings.yourTenders,
|
||||||
|
),
|
||||||
SizedBox(height: 20.0.h()),
|
SizedBox(height: 20.0.h()),
|
||||||
const FilterButton(platformType: PlatformType.tabletDesktop),
|
const FilterButton(platformType: PlatformType.tabletDesktop),
|
||||||
|
|
||||||
@@ -106,103 +108,7 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
|
|||||||
Expanded(child: content),
|
Expanded(child: content),
|
||||||
SizedBox(height: 10.0.h()),
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
Row(
|
_listPagesControll(context, viewModel),
|
||||||
children: [
|
|
||||||
const Spacer(),
|
|
||||||
Text(
|
|
||||||
YourTendersStrings.page,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.0.w()),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final selectedPage = await showDialog<int>(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return AlertDialog(
|
|
||||||
backgroundColor:
|
|
||||||
AppColors.backgroundColor,
|
|
||||||
title: const Text(
|
|
||||||
YourTendersStrings.selectPage,
|
|
||||||
),
|
|
||||||
content: SizedBox(
|
|
||||||
width: 200.0.w(),
|
|
||||||
height: 300.0.h(),
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: viewModel.totalPages,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final pageNumber = index + 1;
|
|
||||||
return ListTile(
|
|
||||||
title: Text(
|
|
||||||
'${YourTendersStrings.page} $pageNumber',
|
|
||||||
),
|
|
||||||
onTap:
|
|
||||||
() => Navigator.pop(
|
|
||||||
context,
|
|
||||||
pageNumber,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedPage != null) {
|
|
||||||
await viewModel.jumpToPage(selectedPage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColors.grey30,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'${viewModel.currentPage}',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
const Icon(Icons.arrow_drop_down),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
YourTendersStrings.of,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'${viewModel.totalPages}',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
SizedBox(height: 30.0.h()),
|
||||||
],
|
],
|
||||||
@@ -218,4 +124,95 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _listPagesControll(
|
||||||
|
BuildContext context,
|
||||||
|
YourTendersViewModel viewModel,
|
||||||
|
) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
YourTendersStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final selectedPage = await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor: AppColors.backgroundColor,
|
||||||
|
title: const Text(YourTendersStrings.selectPage),
|
||||||
|
content: SizedBox(
|
||||||
|
width: 200.0.w(),
|
||||||
|
height: 300.0.h(),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: viewModel.totalPages,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final pageNumber = index + 1;
|
||||||
|
return ListTile(
|
||||||
|
title: Text('${YourTendersStrings.page} $pageNumber'),
|
||||||
|
onTap: () => Navigator.pop(context, pageNumber),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedPage != null) {
|
||||||
|
await viewModel.jumpToPage(selectedPage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.grey30, width: 1),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'${viewModel.currentPage}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
const Icon(Icons.arrow_drop_down),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
YourTendersStrings.of,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'${viewModel.totalPages}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ 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/your_tenders_view_model.dart';
|
import 'package:tm_app/view_models/your_tenders_view_model.dart';
|
||||||
|
import 'package:tm_app/views/shared/tablet_desktop_appbar.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/filter_button.dart';
|
import 'package:tm_app/views/your_tenders/widgets/filter_button.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/liked_disliked_tenders_list.dart';
|
import 'package:tm_app/views/your_tenders/widgets/liked_disliked_tenders_list.dart';
|
||||||
import 'package:tm_app/views/your_tenders/widgets/tablet_desktop_appbar.dart';
|
|
||||||
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
|
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
|
||||||
|
|
||||||
import '../../../core/constants/tender_feedback.dart';
|
import '../../../core/constants/tender_feedback.dart';
|
||||||
@@ -52,7 +52,9 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
|
|||||||
const SizedBox(height: 64.0),
|
const SizedBox(height: 64.0),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
child: const TabletDesktopAppbar(),
|
child: const TabletDesktopAppbar(
|
||||||
|
title: YourTendersStrings.yourTenders,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
const FilterButton(platformType: PlatformType.tabletDesktop),
|
const FilterButton(platformType: PlatformType.tabletDesktop),
|
||||||
@@ -111,103 +113,7 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
|
|||||||
Expanded(child: content),
|
Expanded(child: content),
|
||||||
SizedBox(height: 10.0.h()),
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
Row(
|
_listPagesControll(context, viewModel),
|
||||||
children: [
|
|
||||||
const Spacer(),
|
|
||||||
Text(
|
|
||||||
YourTendersStrings.page,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.0.w()),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final selectedPage = await showDialog<int>(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return AlertDialog(
|
|
||||||
backgroundColor:
|
|
||||||
AppColors.backgroundColor,
|
|
||||||
title: const Text(
|
|
||||||
YourTendersStrings.selectPage,
|
|
||||||
),
|
|
||||||
content: SizedBox(
|
|
||||||
width: 200.0.w(),
|
|
||||||
height: 300.0.h(),
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: viewModel.totalPages,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final pageNumber = index + 1;
|
|
||||||
return ListTile(
|
|
||||||
title: Text(
|
|
||||||
'${YourTendersStrings.page} $pageNumber',
|
|
||||||
),
|
|
||||||
onTap:
|
|
||||||
() => Navigator.pop(
|
|
||||||
context,
|
|
||||||
pageNumber,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedPage != null) {
|
|
||||||
await viewModel.jumpToPage(selectedPage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColors.grey30,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'${viewModel.currentPage}',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
const Icon(Icons.arrow_drop_down),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 5.0),
|
|
||||||
Text(
|
|
||||||
YourTendersStrings.page,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
'${viewModel.totalPages}',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
const SizedBox(height: 30.0),
|
const SizedBox(height: 30.0),
|
||||||
],
|
],
|
||||||
@@ -221,4 +127,95 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _listPagesControll(
|
||||||
|
BuildContext context,
|
||||||
|
YourTendersViewModel viewModel,
|
||||||
|
) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
YourTendersStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final selectedPage = await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor: AppColors.backgroundColor,
|
||||||
|
title: const Text(YourTendersStrings.selectPage),
|
||||||
|
content: SizedBox(
|
||||||
|
width: 200.0.w(),
|
||||||
|
height: 300.0.h(),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: viewModel.totalPages,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final pageNumber = index + 1;
|
||||||
|
return ListTile(
|
||||||
|
title: Text('${YourTendersStrings.page} $pageNumber'),
|
||||||
|
onTap: () => Navigator.pop(context, pageNumber),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedPage != null) {
|
||||||
|
await viewModel.jumpToPage(selectedPage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.grey30, width: 1),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'${viewModel.currentPage}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
const Icon(Icons.arrow_drop_down),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 5.0),
|
||||||
|
Text(
|
||||||
|
YourTendersStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
'${viewModel.totalPages}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_svg/svg.dart';
|
|
||||||
import 'package:go_router/go_router.dart';
|
|
||||||
import 'package:tm_app/core/utils/size_config.dart';
|
|
||||||
|
|
||||||
import '../../../core/constants/assets.dart';
|
|
||||||
import '../../../core/theme/colors.dart';
|
|
||||||
import '../strings/your_tenders_strings.dart';
|
|
||||||
|
|
||||||
class TabletDesktopAppbar extends StatelessWidget {
|
|
||||||
const TabletDesktopAppbar({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
InkWell(
|
|
||||||
onTap: () => context.pop(),
|
|
||||||
child: SvgPicture.asset(AssetsManager.arrowLeft),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8.0.w()),
|
|
||||||
Text(
|
|
||||||
YourTendersStrings.yourTenders,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/utils/date_utils.dart';
|
import 'package:tm_app/core/utils/date_utils.dart';
|
||||||
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
|
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
|
||||||
|
|
||||||
import '../../../core/constants/assets.dart';
|
import '../../../core/constants/assets.dart';
|
||||||
import '../../../core/constants/tender_approval_status.dart';
|
import '../../../core/constants/tender_approval_status.dart';
|
||||||
import '../../../core/constants/tender_feedback.dart';
|
|
||||||
import '../../../core/theme/colors.dart';
|
import '../../../core/theme/colors.dart';
|
||||||
import '../../../core/utils/size_config.dart';
|
import '../../../core/utils/size_config.dart';
|
||||||
|
import '../../../view_models/your_tenders_view_model.dart';
|
||||||
import '../../shared/flag.dart';
|
import '../../shared/flag.dart';
|
||||||
|
|
||||||
class TenderCard extends StatelessWidget {
|
class TenderCard extends StatelessWidget {
|
||||||
@@ -26,29 +27,7 @@ class TenderCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Determine styling based on tender status
|
final viewModel = context.read<YourTendersViewModel>();
|
||||||
Color backgroundColor = AppColors.grey0;
|
|
||||||
Color borderColor = AppColors.grey30;
|
|
||||||
String? statusIcon;
|
|
||||||
Color statusCardColor = AppColors.grey0;
|
|
||||||
Color statusTextColor = AppColors.grey60;
|
|
||||||
|
|
||||||
if (status == TenderFeedback.liked.value ||
|
|
||||||
status == TenderApprovalStatus.submitted.value) {
|
|
||||||
backgroundColor = AppColors.green0;
|
|
||||||
borderColor = AppColors.green10;
|
|
||||||
statusIcon = AssetsManager.tickCircle;
|
|
||||||
statusCardColor = AppColors.green20;
|
|
||||||
statusTextColor = AppColors.green30;
|
|
||||||
}
|
|
||||||
if (status == TenderFeedback.disliked.value ||
|
|
||||||
status == TenderApprovalStatus.rejected.value) {
|
|
||||||
backgroundColor = AppColors.red0;
|
|
||||||
borderColor = AppColors.red10;
|
|
||||||
statusIcon = AssetsManager.closeCircle;
|
|
||||||
statusCardColor = AppColors.red10;
|
|
||||||
statusTextColor = AppColors.red20;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
height: isDesktop ? 182.0.h() : 240.0.h(),
|
height: isDesktop ? 182.0.h() : 240.0.h(),
|
||||||
@@ -59,9 +38,9 @@ class TenderCard extends StatelessWidget {
|
|||||||
bottom: 12.0.h(),
|
bottom: 12.0.h(),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: backgroundColor,
|
color: viewModel.getBackGroundColorByStatus(status),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
border: Border.all(color: borderColor),
|
border: Border.all(color: viewModel.getBorderColorByStatus(status)),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(16.0.w()),
|
padding: EdgeInsets.all(16.0.w()),
|
||||||
@@ -88,18 +67,18 @@ class TenderCard extends StatelessWidget {
|
|||||||
vertical: 4.0.h(),
|
vertical: 4.0.h(),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: statusCardColor,
|
color: viewModel.getStatusCardColorByStatus(status),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (statusIcon != null)
|
if (viewModel.getStatusIconByStatus(status) != null)
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
statusIcon,
|
viewModel.getStatusIconByStatus(status)!,
|
||||||
width: 16.0.w(),
|
width: 16.0.w(),
|
||||||
height: 16.0.h(),
|
height: 16.0.h(),
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
statusTextColor,
|
viewModel.getStatusTextColorByStatus(status),
|
||||||
BlendMode.srcIn,
|
BlendMode.srcIn,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -107,7 +86,7 @@ class TenderCard extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
status,
|
status,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: statusTextColor,
|
color: viewModel.getStatusTextColorByStatus(status),
|
||||||
fontSize: 12.0.sp(),
|
fontSize: 12.0.sp(),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user