fixed conflicts

This commit is contained in:
amirrezaghabeli
2025-09-13 12:31:08 +03:30
parent d065316113
commit 5a9d93cdd6
7 changed files with 319 additions and 73 deletions
@@ -9,6 +9,7 @@ import 'package:tm_app/view_models/liked_tenders_view_model.dart';
import 'package:tm_app/views/liked_tenders/widgets/liked_tenders_list_item.dart';
import '../../../core/utils/app_toast.dart';
import '../../shared/base_button.dart';
import '../../shared/desktop_navigation_widget.dart';
import '../strings/liked_tenders_strings.dart';
@@ -53,9 +54,51 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
},
child: Scaffold(
backgroundColor: AppColors.backgroundColor,
endDrawer: Drawer(
backgroundColor: AppColors.backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.horizontal(left: Radius.circular(20)),
),
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()),
],
),
),
),
body: Column(
children: [
DesktopNavigationWidget(currentIndex: 1),
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
Expanded(
child: SizedBox(
width: 740,
@@ -165,7 +208,8 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: AppColors.backgroundColor,
backgroundColor:
AppColors.backgroundColor,
title: const Text(
LikedTendersStrings.selectPage,
),
@@ -219,7 +263,6 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
SizedBox(width: 5.0.w()),
SvgPicture.asset(
AssetsManager.arrowDownSmall,
color: AppColors.grey80,
),
SizedBox(width: 5.0.w()),
],
@@ -261,3 +304,20 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
);
}
}
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,
),
),
),
);
}
@@ -10,7 +10,7 @@ import 'package:tm_app/data/services/model/tender_approvals_data/tender_approval
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/tender_app_bar.dart';
import 'package:tm_app/views/login/widgets/widgets.dart';
class LikedTendersMobilePage extends StatefulWidget {
const LikedTendersMobilePage({super.key});
@@ -73,10 +73,90 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
},
child: Scaffold(
backgroundColor: AppColors.backgroundColor,
appBar: appBar(
context: context,
title: LikedTendersStrings.likedTenders,
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(
backgroundColor: AppColors.backgroundColor,
context: context,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(20),
),
),
builder: (context) {
return 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()),
],
),
),
body: Column(
children: [
Expanded(
@@ -181,3 +261,20 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
);
}
}
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,
),
),
),
);
}
@@ -8,11 +8,11 @@ import 'package:tm_app/core/utils/size_config.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/widgets/liked_tenders_list_item.dart';
import 'package:tm_app/views/shared/base_button.dart';
import '../../../core/utils/app_toast.dart';
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
import '../../shared/tablet_navigation_widget.dart';
import '../../shared/tender_app_bar.dart';
class LikedTendersTabletPage extends StatefulWidget {
const LikedTendersTabletPage({super.key});
@@ -58,7 +58,95 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
child: Scaffold(
key: key,
backgroundColor: AppColors.backgroundColor,
appBar: 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: TabletNavigationWidget(currentIndex: 1),
body: Center(
child: SizedBox(
@@ -175,7 +263,8 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: AppColors.backgroundColor,
backgroundColor:
AppColors.backgroundColor,
title: const Text(
LikedTendersStrings.selectPage,
),
@@ -229,7 +318,6 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
SizedBox(width: 5.0.w()),
SvgPicture.asset(
AssetsManager.arrowDownSmall,
color: AppColors.grey80,
),
SizedBox(width: 5.0.w()),
],
@@ -273,3 +361,20 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
);
}
}
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,
),
),
),
);
}
@@ -16,4 +16,5 @@ class LikedTendersStrings {
static const page = 'Page';
static const selectPage = 'Select Page';
static const of = 'Of';
static const apply = 'Apply';
}
+35 -56
View File
@@ -7,15 +7,23 @@ import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/view_models/home_view_model.dart';
import 'package:tm_app/view_models/tenders_view_model.dart';
import 'package:tm_app/views/home/strings/home_strings.dart';
import 'package:tm_app/views/profile/strings/profile_strings.dart';
import 'package:tm_app/views/tenders/strings/tenders_strings.dart';
import '../../core/routes/app_routes.dart';
class DesktopNavigationWidget extends StatelessWidget {
const DesktopNavigationWidget({required this.currentIndex, super.key});
class DesktopNavigationWidget extends StatelessWidget
implements PreferredSizeWidget {
const DesktopNavigationWidget({
required this.currentIndex,
super.key,
this.haveFilter = false,
});
final int currentIndex;
final bool haveFilter;
@override
Size get preferredSize => const Size.fromHeight(64);
@override
Widget build(BuildContext context) {
@@ -26,20 +34,16 @@ class DesktopNavigationWidget extends StatelessWidget {
border: Border(bottom: BorderSide(color: AppColors.grey30)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 40),
const SizedBox(width: 40),
SvgPicture.asset(AssetsManager.logoSmall),
Spacer(),
const Spacer(),
_navigationItem(
context: context,
text: HomeStrings.home,
isActive: currentIndex == 0,
onTap: () {
if (currentIndex == 0) {
return;
} else {
if (currentIndex != 0) {
Router.neglect(context, () => HomeRouteData().go(context));
context.read<HomeViewModel>().init();
}
@@ -47,15 +51,13 @@ class DesktopNavigationWidget extends StatelessWidget {
iconPath: AssetsManager.home,
activeIconPath: AssetsManager.homeActive,
),
SizedBox(width: 24),
const SizedBox(width: 24),
_navigationItem(
context: context,
text: TendersStrings.tendersTitle,
isActive: currentIndex == 1,
onTap: () {
if (currentIndex == 1) {
return;
} else {
if (currentIndex != 1) {
Router.neglect(context, () => TendersRouteData().go(context));
context.read<TendersViewModel>().getTenders();
}
@@ -63,58 +65,35 @@ class DesktopNavigationWidget extends StatelessWidget {
iconPath: AssetsManager.tenders,
activeIconPath: AssetsManager.tendersActive,
),
SizedBox(width: 24),
const SizedBox(width: 24),
_navigationItem(
context: context,
text: TendersStrings.contracts,
isActive: currentIndex == 2,
onTap: () {
if (currentIndex == 2) {
return;
} else {
// Router.neglect(context, () => TendersRouteData().go(context));
// context.read<TendersViewModel>().getTenders();
}
},
iconPath: AssetsManager.contracts,
activeIconPath: AssetsManager.contracts,
),
SizedBox(width: 24),
_navigationItem(
context: context,
text: TendersStrings.notifications,
isActive: currentIndex == 3,
onTap: () {
if (currentIndex == 3) {
return;
} else {
Router.neglect(
context,
() => NotificationRouteData().go(context),
);
//context.read<notificationViewModel>().getTenders();
}
},
iconPath: AssetsManager.notify,
activeIconPath: AssetsManager.notifyActive,
),
SizedBox(width: 24),
_navigationItem(
context: context,
text: ProfileStrings.profileTitle,
isActive: currentIndex == 4,
onTap: () {
if (currentIndex == 4) {
return;
} else {
if (currentIndex != 2) {
Router.neglect(context, () => ProfileRouteData().go(context));
}
},
iconPath: AssetsManager.profile,
activeIconPath: AssetsManager.profileActive,
),
Spacer(),
SizedBox(width: 68),
const Spacer(),
if (haveFilter)
Builder(
builder:
(context) => IconButton(
icon: SvgPicture.asset(
AssetsManager.filter,
height: 24.0.w(),
width: 24.0.w(),
),
onPressed: () {
Scaffold.of(context).openEndDrawer();
},
),
),
const SizedBox(width: 68),
],
),
);
@@ -138,7 +117,7 @@ class DesktopNavigationWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(isActive ? activeIconPath : iconPath),
SizedBox(width: 8),
const SizedBox(width: 8),
Text(
text,
style: TextStyle(