Merge pull request 'changed safe areas and filter string' (#180) from fixes into main

Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/180
This commit is contained in:
a.ghabeli
2025-09-28 08:51:20 +03:30
5 changed files with 104 additions and 103 deletions
@@ -75,14 +75,14 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return SafeArea(
backgroundColor: AppColors.backgroundColor, child: Scaffold(
appBar: appBar( backgroundColor: AppColors.backgroundColor,
context: context, appBar: appBar(
title: TenderDetailsStrings.tenderDetailTitle, context: context,
), title: TenderDetailsStrings.tenderDetailTitle,
body: SafeArea( ),
child: Consumer<TenderDetailViewModel>( body: Consumer<TenderDetailViewModel>(
builder: (context, tenderViewModel, child) { builder: (context, tenderViewModel, child) {
if (tenderViewModel.isLoading) { if (tenderViewModel.isLoading) {
return const Center( return const Center(
@@ -70,94 +70,94 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
}); });
} }
}, },
child: Scaffold( child: SafeArea(
backgroundColor: AppColors.backgroundColor, child: Scaffold(
appBar: PreferredSize( backgroundColor: AppColors.backgroundColor,
preferredSize: const Size.fromHeight(60), appBar: PreferredSize(
child: AppBar( preferredSize: const Size.fromHeight(60),
backgroundColor: AppColors.backgroundColor, child: AppBar(
elevation: 0, backgroundColor: AppColors.backgroundColor,
titleSpacing: 0, elevation: 0,
leading: IconButton( titleSpacing: 0,
icon: SvgPicture.asset( leading: IconButton(
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( icon: SvgPicture.asset(
AssetsManager.filter, AssetsManager.arrowLeft,
height: 24.0.w(), height: 24.0.w(),
width: 24.0.w(), width: 24.0.w(),
), ),
onPressed: () { onPressed: () => Navigator.pop(context),
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,
),
],
),
);
},
);
},
), ),
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()), SizedBox(width: 16.0.w()),
], ],
),
), ),
),
body: SafeArea( body: Column(
child: Column(
children: [ children: [
Expanded( Expanded(
child: Consumer<LikedTendersViewModel>( child: Consumer<LikedTendersViewModel>(
@@ -170,22 +170,22 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
), ),
); );
} }
if (viewModel.errorMessage != null) { if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!)); return Center(child: Text(viewModel.errorMessage!));
} }
final feedback = viewModel.data?.data?.feedback ?? []; final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) { if (feedback.isEmpty) {
return const Center( return const Center(
child: Text(LikedTendersStrings.noLikedTenders), child: Text(LikedTendersStrings.noLikedTenders),
); );
} }
final itemCount = final itemCount =
feedback.length + (viewModel.isLoadingMore ? 1 : 0); feedback.length + (viewModel.isLoadingMore ? 1 : 0);
return ListView.builder( return ListView.builder(
controller: _scrollController, controller: _scrollController,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@@ -196,7 +196,7 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index < feedback.length) { if (index < feedback.length) {
final item = feedback[index]; final item = feedback[index];
return Padding( return Padding(
padding: EdgeInsets.only(bottom: 20.0.h()), padding: EdgeInsets.only(bottom: 20.0.h()),
child: Dismissible( child: Dismissible(
@@ -35,11 +35,11 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return SafeArea(
backgroundColor: AppColors.backgroundColor, child: Scaffold(
appBar: appBar(context: context, title: YourTendersStrings.yourTenders), backgroundColor: AppColors.backgroundColor,
body: SafeArea( appBar: appBar(context: context, title: YourTendersStrings.yourTenders),
child: Column( body: Column(
children: [ children: [
const FilterButton(platformType: PlatformType.mobile), const FilterButton(platformType: PlatformType.mobile),
Expanded( Expanded(
@@ -55,11 +55,11 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
), ),
); );
} }
if (viewModel.errorMessage != null) { if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!)); return Center(child: Text(viewModel.errorMessage!));
} }
return Column( return Column(
children: [ children: [
if (viewModel.selectedStatus == if (viewModel.selectedStatus ==
@@ -15,10 +15,11 @@ class YourTendersStrings {
static const approvedTenders = 'Approved tenders'; static const approvedTenders = 'Approved tenders';
static const noTenders = 'No data available'; static const noTenders = 'No data available';
static const selectPublicationRangeDate = 'Select publication date range'; static const selectPublicationRangeDate = 'Select publication date range';
static const selectCreationRangeDate = 'Select Creation date range';
static const noLikedTenders = 'You havent liked any tenders yet !'; static const noLikedTenders = 'You havent liked any tenders yet !';
static const noDislikedTenders = 'You havent disliked any tenders yet !'; static const noDislikedTenders = 'You havent disliked any tenders yet !';
static const noTendersSubmitted = 'You havent submitted any tenders yet !'; static const noTendersSubmitted = 'You havent submitted any tenders yet !';
static const page = 'Page'; static const page = 'Page';
static const of = 'of'; static const of = 'of';
static const selectPage ='Select Page'; static const selectPage = 'Select Page';
} }
@@ -115,7 +115,7 @@ class YourTendersFilterDialog extends StatelessWidget {
), ),
SizedBox(height: 16.0.h()), SizedBox(height: 16.0.h()),
Text( Text(
YourTendersStrings.selectPublicationRangeDate, YourTendersStrings.selectCreationRangeDate,
style: TextStyle( style: TextStyle(
fontSize: 16.0.sp(), fontSize: 16.0.sp(),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,