From d804d5f26eed18dd06dfa40d31d4e6f9e90d9448 Mon Sep 17 00:00:00 2001 From: llsajjad Date: Tue, 16 Sep 2025 12:43:25 +0330 Subject: [PATCH] fixed liked tender filter bar --- lib/core/config/app_config.dart | 4 +- .../final_completion_of_documents_screen.dart | 12 +- .../pages/liked_tenders_tablet_page.dart | 266 ++++++++++++------ lib/views/shared/tender_app_bar.dart | 1 + pubspec.lock | 48 ++++ 5 files changed, 232 insertions(+), 99 deletions(-) diff --git a/lib/core/config/app_config.dart b/lib/core/config/app_config.dart index 760274f..d23a8e0 100644 --- a/lib/core/config/app_config.dart +++ b/lib/core/config/app_config.dart @@ -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'; diff --git a/lib/views/final_completion_of_documents/pages/final_completion_of_documents_screen.dart b/lib/views/final_completion_of_documents/pages/final_completion_of_documents_screen.dart index 8256cd2..984e9b7 100644 --- a/lib/views/final_completion_of_documents/pages/final_completion_of_documents_screen.dart +++ b/lib/views/final_completion_of_documents/pages/final_completion_of_documents_screen.dart @@ -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), diff --git a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart index 1ad142e..fd61c08 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart @@ -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 { 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( builder: (context, viewModel, child) { @@ -233,7 +319,7 @@ class _LikedTendersTabletPageState extends State { }, child: LikedListItem( tender: item.tender!, - approval: approval!, + approval: approval, ), ), ); diff --git a/lib/views/shared/tender_app_bar.dart b/lib/views/shared/tender_app_bar.dart index 2a1d627..58cf072 100644 --- a/lib/views/shared/tender_app_bar.dart +++ b/lib/views/shared/tender_app_bar.dart @@ -68,6 +68,7 @@ PreferredSizeWidget tabletAppBar({ return PreferredSize( preferredSize: const Size.fromHeight(64), child: AppBar( + scrolledUnderElevation: 0, backgroundColor: AppColors.backgroundColor, elevation: 0, titleSpacing: 0, diff --git a/pubspec.lock b/pubspec.lock index 59ac43a..57e754e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -177,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -209,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" dio: dependency: "direct main" description: @@ -225,6 +241,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + dotted_border: + dependency: "direct main" + description: + name: dotted_border + sha256: "99b091ec6891ba0c5331fdc2b502993c7c108f898995739a73c6845d71dad70c" + url: "https://pub.dev" + source: hosted + version: "3.1.0" equatable: dependency: transitive description: @@ -257,6 +281,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_picker: + dependency: "direct main" + description: + name: file_picker + sha256: f2d9f173c2c14635cc0e9b14c143c49ef30b4934e8d1d274d6206fcb0086a06f + url: "https://pub.dev" + source: hosted + version: "10.3.3" fixnum: dependency: transitive description: @@ -302,6 +334,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: b0694b7fb1689b0e6cc193b3f1fcac6423c4f93c74fb20b806c6b6f196db0c31 + url: "https://pub.dev" + source: hosted + version: "2.0.30" flutter_svg: dependency: "direct main" description: @@ -989,6 +1029,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + win32: + dependency: transitive + description: + name: win32 + sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" + url: "https://pub.dev" + source: hosted + version: "5.13.0" xdg_directories: dependency: transitive description: