fixed liked tender filter bar

This commit is contained in:
llsajjad
2025-09-16 12:43:25 +03:30
parent 8ad05f5c68
commit d804d5f26e
5 changed files with 232 additions and 99 deletions
+2 -2
View File
@@ -8,14 +8,14 @@ class AppConfig {
// این متد بر اساس محیط فعال، URL مناسب را برمی‌گرداند.
static String get apiBaseUrl {
return 'http://10.0.2.2:8081';
// return 'http://10.0.2.2:8081';
// return '192.168.1.103:8081';
// if (isDevelopment) {
// // Handle different platforms for local development
// if (kIsWeb) {
// For web, use localhost
// return 'https://app.opplens.com';
// return 'http://localhost:8081';
return 'http://localhost:8081';
// } else {
// For Android emulator, use 10.0.2.2 (special IP for host machine)
// return 'http://10.0.2.2:8081';
@@ -215,13 +215,11 @@ class FormCard extends StatelessWidget {
decoration: InputDecoration(
filled: true,
fillColor: AppColors.grey0,
hint: Text(
FinalCompletionOfDocumentsStrings.describeYourTeamHint,
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
hintText: FinalCompletionOfDocumentsStrings.describeYourTeamHint,
hintStyle: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
border: OutlineInputBorder(
borderSide: const BorderSide(color: AppColors.secondaryborder2),
@@ -9,6 +9,7 @@ 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/widgets/liked_tenders_list_item.dart';
import 'package:tm_app/views/shared/base_button.dart';
import 'package:tm_app/views/shared/tender_app_bar.dart';
import '../../../core/utils/app_toast.dart';
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
@@ -58,101 +59,186 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
child: Scaffold(
key: key,
backgroundColor: AppColors.backgroundColor,
appBar: 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),
appBar:
// 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),
body: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
AppBar(
backgroundColor: AppColors.backgroundColor,
elevation: 0,
titleSpacing: 0,
scrolledUnderElevation: 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()),
],
),
Expanded(
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
@@ -233,7 +319,7 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
},
child: LikedListItem(
tender: item.tender!,
approval: approval!,
approval: approval,
),
),
);
+1
View File
@@ -68,6 +68,7 @@ PreferredSizeWidget tabletAppBar({
return PreferredSize(
preferredSize: const Size.fromHeight(64),
child: AppBar(
scrolledUnderElevation: 0,
backgroundColor: AppColors.backgroundColor,
elevation: 0,
titleSpacing: 0,