Added SafeArea to all page

This commit is contained in:
llsajjad
2025-09-24 13:19:37 +03:30
parent 7456418ea2
commit e5cf89c2ce
23 changed files with 1060 additions and 1016 deletions
@@ -18,215 +18,217 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget {
context: context,
title: CompletionOfDocumentsStrings.completionOfDocuments,
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 24.0.h(),
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
CompletionOfDocumentsStrings.submissionDeadline,
style: TextStyle(
color: AppColors.textBlue,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
Text(
'2025-06-15',
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
],
),
),
SizedBox(height: 12.0.h()),
Container(
height: 58.0.h(),
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: 12.0.w(),
vertical: 8.0.h(),
),
decoration: BoxDecoration(
border: Border.all(color: AppColors.orange10),
borderRadius: BorderRadius.circular(8),
color: AppColors.orange0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'Match with your profile',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
const Spacer(),
Text(
'75%',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.cyanTeal,
fontWeight: FontWeight.w600,
),
),
],
),
SizedBox(height: 4.0.h()),
Row(
children: [
Expanded(
child: LinearProgressIndicator(
value: 0.75,
backgroundColor: const Color(0xFFE0E0E0),
color: AppColors.cyanTeal,
minHeight: 6,
borderRadius: BorderRadius.circular(10),
),
),
],
),
],
),
),
SizedBox(height: 16.0.h()),
_docCard(
title: 'Company Registration Certificate',
subtitle: 'Legal document proving business registration',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary20,
),
_docCard(
title: 'Tax Compliance Certificate',
subtitle: 'Proof of tax registration and compliance',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary30,
),
_docCard(
title: 'Technical Proposal',
subtitle: 'Detailed technical solution for the tender',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Self apply',
tagColor: AppColors.green30,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.green20,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Partnership',
tagColor: AppColors.purple,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.purpleLight,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
borderSideColor: AppColors.red10,
),
SizedBox(height: 16.0.h()),
Text(
CompletionOfDocumentsStrings.setDeadline,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8.0.h()),
Container(
height: 48.0.h(),
padding: EdgeInsets.symmetric(horizontal: 12.0.w()),
decoration: BoxDecoration(
border: Border.all(color: AppColors.grey40),
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'2025/04/10',
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w700,
color: AppColors.grey60,
),
),
SvgPicture.asset(
AssetsManager.calendar,
height: 24.0.h(),
width: 24.0.w(),
),
],
),
),
SizedBox(height: 16.0.h()),
Container(
padding: const EdgeInsets.all(12),
height: 100.0.h(),
decoration: BoxDecoration(
border: Border.all(color: AppColors.borderColor),
borderRadius: BorderRadius.circular(8),
color: AppColors.grey0,
),
child: TextField(
maxLines: null,
decoration: const InputDecoration.collapsed(
hintText: CompletionOfDocumentsStrings.note,
body: SafeArea(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 24.0.h(),
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
CompletionOfDocumentsStrings.submissionDeadline,
style: TextStyle(
color: AppColors.textBlue,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
Text(
'2025-06-15',
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
],
),
),
SizedBox(height: 12.0.h()),
Container(
height: 58.0.h(),
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: 12.0.w(),
vertical: 8.0.h(),
),
decoration: BoxDecoration(
border: Border.all(color: AppColors.orange10),
borderRadius: BorderRadius.circular(8),
color: AppColors.orange0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'Match with your profile',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
const Spacer(),
Text(
'75%',
style: TextStyle(
fontSize: 12.0.sp(),
color: AppColors.cyanTeal,
fontWeight: FontWeight.w600,
),
),
],
),
SizedBox(height: 4.0.h()),
Row(
children: [
Expanded(
child: LinearProgressIndicator(
value: 0.75,
backgroundColor: const Color(0xFFE0E0E0),
color: AppColors.cyanTeal,
minHeight: 6,
borderRadius: BorderRadius.circular(10),
),
),
],
),
],
),
),
SizedBox(height: 16.0.h()),
_docCard(
title: 'Company Registration Certificate',
subtitle: 'Legal document proving business registration',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary20,
),
_docCard(
title: 'Tax Compliance Certificate',
subtitle: 'Proof of tax registration and compliance',
status: 'Completed',
statusColor: AppColors.green30,
statusBackgroundColor: AppColors.green10,
backgroundColor: AppColors.primary10,
borderSideColor: AppColors.primary30,
),
_docCard(
title: 'Technical Proposal',
subtitle: 'Detailed technical solution for the tender',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Self apply',
tagColor: AppColors.green30,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.green20,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
tag: 'Partnership',
tagColor: AppColors.purple,
borderSideColor: AppColors.red10,
tagBackgroundColor: AppColors.purpleLight,
),
_docCard(
title: 'Financial Proposal',
subtitle: 'Detailed cost breakdown and pricing',
status: 'Incomplete',
statusColor: AppColors.red20,
statusBackgroundColor: AppColors.red10,
backgroundColor: AppColors.red0,
borderSideColor: AppColors.red10,
),
SizedBox(height: 16.0.h()),
Text(
CompletionOfDocumentsStrings.setDeadline,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey60,
fontWeight: FontWeight.w400,
color: AppColors.grey80,
fontWeight: FontWeight.w600,
),
),
),
SizedBox(height: 24.0.h()),
BaseButton(
isEnabled: true,
onPressed: () {},
text: CompletionOfDocumentsStrings.submitForCompletion,
textColor: AppColors.textBlue,
backgroundColor: AppColors.primary30,
),
],
SizedBox(height: 8.0.h()),
Container(
height: 48.0.h(),
padding: EdgeInsets.symmetric(horizontal: 12.0.w()),
decoration: BoxDecoration(
border: Border.all(color: AppColors.grey40),
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'2025/04/10',
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w700,
color: AppColors.grey60,
),
),
SvgPicture.asset(
AssetsManager.calendar,
height: 24.0.h(),
width: 24.0.w(),
),
],
),
),
SizedBox(height: 16.0.h()),
Container(
padding: const EdgeInsets.all(12),
height: 100.0.h(),
decoration: BoxDecoration(
border: Border.all(color: AppColors.borderColor),
borderRadius: BorderRadius.circular(8),
color: AppColors.grey0,
),
child: TextField(
maxLines: null,
decoration: const InputDecoration.collapsed(
hintText: CompletionOfDocumentsStrings.note,
),
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey60,
fontWeight: FontWeight.w400,
),
),
),
SizedBox(height: 24.0.h()),
BaseButton(
isEnabled: true,
onPressed: () {},
text: CompletionOfDocumentsStrings.submitForCompletion,
textColor: AppColors.textBlue,
backgroundColor: AppColors.primary30,
),
],
),
),
),
);
+35 -33
View File
@@ -96,44 +96,46 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
}
return Column(
children: [
const DesktopNavigationWidget(
currentIndex: 1, // Home index
),
Expanded(
child: SingleChildScrollView(
child: Center(
child: SizedBox(
width: 740,
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TabletDesktopAppbar(
title: TenderDetailsStrings.tenderDetailTitle,
),
SizedBox(height: 32.0.h()),
TenderDetailHeader(
isScreenBig: true,
detail: detail,
),
SizedBox(height: 32.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(
isScreenBig: true,
detail: detail,
),
],
return SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(
currentIndex: 1, // Home index
),
Expanded(
child: SingleChildScrollView(
child: Center(
child: SizedBox(
width: 740,
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TabletDesktopAppbar(
title: TenderDetailsStrings.tenderDetailTitle,
),
SizedBox(height: 32.0.h()),
TenderDetailHeader(
isScreenBig: true,
detail: detail,
),
SizedBox(height: 32.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(
isScreenBig: true,
detail: detail,
),
],
),
),
),
),
),
),
),
],
],
),
);
},
),
+17 -15
View File
@@ -102,21 +102,23 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
);
}
return SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.0.w(),
vertical: 16.0.h(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TenderDetailHeader(isScreenBig: false, detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: false, detail: detail),
],
return SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.0.w(),
vertical: 16.0.h(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TenderDetailHeader(isScreenBig: false, detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: false, detail: detail),
],
),
),
),
);
+22 -20
View File
@@ -104,26 +104,28 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
if (detail == null) {
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
}
return SingleChildScrollView(
child: Center(
child: SizedBox(
width: 768,
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TabletDesktopAppbar(
title: TenderDetailsStrings.tenderDetailTitle,
),
SizedBox(height: 28.0.h()),
TenderDetailHeader(isScreenBig: true, detail: detail),
SizedBox(height: 28.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: true, detail: detail),
],
return SafeArea(
child: SingleChildScrollView(
child: Center(
child: SizedBox(
width: 768,
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TabletDesktopAppbar(
title: TenderDetailsStrings.tenderDetailTitle,
),
SizedBox(height: 28.0.h()),
TenderDetailHeader(isScreenBig: true, detail: detail),
SizedBox(height: 28.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: true, detail: detail),
],
),
),
),
),
@@ -23,55 +23,57 @@ class FinalCompletionOfDocumentsScreen extends StatelessWidget {
return Scaffold(
body: Consumer<FinalCompletionOfDocumentsViewModel>(
builder:
(context, viewModel, child) => Column(
children: [
const DesktopNavigationWidget(currentIndex: 1),
const SizedBox(height: 64.0),
Expanded(
child: SizedBox(
width: 740,
child: SingleChildScrollView(
child: Column(
children: [
const TabletDesktopAppbar(
title:
FinalCompletionOfDocumentsStrings
.completionOfDocuments,
),
SizedBox(height: 32.0.h()),
const SizedBox(height: 32.0),
const CommentBox(),
const SizedBox(height: 32.0),
FormCard(viewModel: viewModel),
const SizedBox(height: 40.0),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
BaseButton(
isEnabled: true,
onPressed: () {},
width: 176,
backgroundColor: AppColors.primary10,
textColor: AppColors.mainBlue,
text: FinalCompletionOfDocumentsStrings.back,
),
const SizedBox(width: 16.0),
BaseButton(
isEnabled: true,
onPressed: () {},
width: 176,
text: FinalCompletionOfDocumentsStrings.next,
),
],
),
const SizedBox(height: 35.0),
],
(context, viewModel, child) => SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1),
const SizedBox(height: 64.0),
Expanded(
child: SizedBox(
width: 740,
child: SingleChildScrollView(
child: Column(
children: [
const TabletDesktopAppbar(
title:
FinalCompletionOfDocumentsStrings
.completionOfDocuments,
),
SizedBox(height: 32.0.h()),
const SizedBox(height: 32.0),
const CommentBox(),
const SizedBox(height: 32.0),
FormCard(viewModel: viewModel),
const SizedBox(height: 40.0),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
BaseButton(
isEnabled: true,
onPressed: () {},
width: 176,
backgroundColor: AppColors.primary10,
textColor: AppColors.mainBlue,
text: FinalCompletionOfDocumentsStrings.back,
),
const SizedBox(width: 16.0),
BaseButton(
isEnabled: true,
onPressed: () {},
width: 176,
text: FinalCompletionOfDocumentsStrings.next,
),
],
),
const SizedBox(height: 35.0),
],
),
),
),
),
),
],
],
),
),
),
);
+22 -20
View File
@@ -39,26 +39,28 @@ class DesktopHomePage extends StatelessWidget {
if (homeViewModel.tenderApprovalsStateResponse != null &&
homeViewModel.data != null &&
homeViewModel.feedbackStats != null) {
return SingleChildScrollView(
child: SizedBox(
width: 780,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
const SizedBox(height: 40.0),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
child: _firstTenderCardsRow(context, homeViewModel),
),
SizedBox(height: 32.0.h()),
_yourTenderText(homeViewModel),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
return SafeArea(
child: SingleChildScrollView(
child: SizedBox(
width: 780,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
const SizedBox(height: 40.0),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
child: _firstTenderCardsRow(context, homeViewModel),
),
SizedBox(height: 32.0.h()),
_yourTenderText(homeViewModel),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
),
),
),
);
+21 -19
View File
@@ -33,25 +33,27 @@ class MobileHomePage extends StatelessWidget {
if (homeViewModel.tenderApprovalsStateResponse != null &&
homeViewModel.data != null &&
homeViewModel.feedbackStats != null) {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(height: 18.0.h()),
// NotificationCard(),
SizedBox(height: 32.0.h()),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
_firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
),
SizedBox(height: 8.0.h()),
_secondTenderCardsRow(homeViewModel, context),
SizedBox(height: 40.0.h()),
_yourTenderText(homeViewModel),
_bottomListView(homeViewModel),
],
return SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(height: 18.0.h()),
// NotificationCard(),
SizedBox(height: 32.0.h()),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
_firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
),
SizedBox(height: 8.0.h()),
_secondTenderCardsRow(homeViewModel, context),
SizedBox(height: 40.0.h()),
_yourTenderText(homeViewModel),
_bottomListView(homeViewModel),
],
),
),
);
}
+20 -18
View File
@@ -50,24 +50,26 @@ class TabletHomePage extends StatelessWidget {
24.0.w(),
24.0.h(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// NotificationCard(),
SizedBox(height: 40.0.h()),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
_firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
),
SizedBox(height: 8.0.h()),
_secondTenderCardsRow(homeViewModel, context),
SizedBox(height: 32.0.h()),
_yourTenderText(homeViewModel),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// NotificationCard(),
SizedBox(height: 40.0.h()),
_progressBarsRow(homeViewModel),
SizedBox(height: 32.0.h()),
_firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
),
SizedBox(height: 8.0.h()),
_secondTenderCardsRow(homeViewModel, context),
SizedBox(height: 32.0.h()),
_yourTenderText(homeViewModel),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
),
),
),
);
@@ -59,71 +59,73 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
key: scaffoldKey,
backgroundColor: AppColors.backgroundColor,
endDrawer: const LikeFiltersDrawer(),
body: Column(
children: [
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(
child: SizedBox(
body: SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
const SizedBox(height: 40),
SizedBox(
width: 740,
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final currentPage = viewModel.currentPage;
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
return Column(
children: [
_likedTendersList(feedback, viewModel),
SizedBox(height: 10.0.h()),
_likedTenersListPageControll(
context,
totalPages,
viewModel,
currentPage,
),
SizedBox(height: 30.0.h()),
],
);
child: TabletDesktopAppbar(
title: LikedTendersStrings.likedTenders,
haveFilter: true,
onFilterPressed: () {
scaffoldKey.currentState?.openEndDrawer();
},
),
),
),
],
const SizedBox(height: 24),
Expanded(
child: SizedBox(
width: 740,
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final currentPage = viewModel.currentPage;
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
return Column(
children: [
_likedTendersList(feedback, viewModel),
SizedBox(height: 10.0.h()),
_likedTenersListPageControll(
context,
totalPages,
viewModel,
currentPage,
),
SizedBox(height: 30.0.h()),
],
);
},
),
),
),
],
),
),
),
);
@@ -156,91 +156,93 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
),
),
body: Column(
children: [
Expanded(
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
body: SafeArea(
child: Column(
children: [
Expanded(
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final itemCount =
feedback.length + (viewModel.isLoadingMore ? 1 : 0);
return ListView.builder(
controller: _scrollController,
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
vertical: 15.0.h(),
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final itemCount =
feedback.length + (viewModel.isLoadingMore ? 1 : 0);
return ListView.builder(
controller: _scrollController,
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
vertical: 15.0.h(),
),
itemCount: itemCount,
itemBuilder: (context, index) {
if (index < feedback.length) {
final item = feedback[index];
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(),
itemCount: itemCount,
itemBuilder: (context, index) {
if (index < feedback.length) {
final item = feedback[index];
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(),
),
),
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!),
),
);
} else {
return Padding(
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
child: Center(
child: SizedBox(
width: 24.0.w(),
height: 24.0.h(),
child: const CircularProgressIndicator(
color: AppColors.secondary50,
strokeWidth: 2,
),
),
),
onDismissed: (_) {
if (item.tenderId != null) {
viewModel.removeTenderById(item.tenderId!);
}
},
child: LikedListItem(tender: item.tender!),
),
);
} else {
return Padding(
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
child: Center(
child: SizedBox(
width: 24.0.w(),
height: 24.0.h(),
child: const CircularProgressIndicator(
color: AppColors.secondary50,
strokeWidth: 2,
),
),
),
);
}
},
);
},
);
}
},
);
},
),
),
),
],
],
),
),
),
);
@@ -63,79 +63,81 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
drawer: const TabletNavigationWidget(currentIndex: 1),
body: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
TabletDesktopAppbar(
title: LikedTendersStrings.likedTenders,
haveFilter: true,
onFilterPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColors.backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(20),
body: SafeArea(
child: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
TabletDesktopAppbar(
title: LikedTendersStrings.likedTenders,
haveFilter: true,
onFilterPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColors.backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(20),
),
),
),
constraints: BoxConstraints(
maxWidth: MediaQuery.sizeOf(context).width,
maxHeight: MediaQuery.sizeOf(context).height,
),
builder: (context) => const LikeFiltersBottomSheet(),
);
},
),
Expanded(
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final currentPage = viewModel.currentPage;
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
return Column(
children: [
_likedTendersList(feedback, viewModel),
SizedBox(height: 10.0.h()),
_likeTendersListPagesControll(
context,
totalPages,
viewModel,
currentPage,
),
SizedBox(height: 30.0.h()),
],
constraints: BoxConstraints(
maxWidth: MediaQuery.sizeOf(context).width,
maxHeight: MediaQuery.sizeOf(context).height,
),
builder: (context) => const LikeFiltersBottomSheet(),
);
},
),
),
],
Expanded(
child: Consumer<LikedTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.feedback ?? []).isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
final feedback = viewModel.data?.data?.feedback ?? [];
if (feedback.isEmpty) {
return const Center(
child: Text(LikedTendersStrings.noLikedTenders),
);
}
final currentPage = viewModel.currentPage;
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
return Column(
children: [
_likedTendersList(feedback, viewModel),
SizedBox(height: 10.0.h()),
_likeTendersListPagesControll(
context,
totalPages,
viewModel,
currentPage,
),
SizedBox(height: 30.0.h()),
],
);
},
),
),
],
),
),
),
),
+74 -72
View File
@@ -64,85 +64,87 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
return const Center(child: Text(CommonStrings.noData));
}
return Column(
children: [
const DesktopNavigationWidget(
currentIndex: 4, // Tenders index
),
SizedBox(
width: 740,
child: Column(
children: [
SizedBox(height: 36.0.h()),
TitleDescription(
title: ProfileStrings.companyName,
description: viewModel.companyProfileData!.name!,
),
TitleDescription(
title: ProfileStrings.nationalId,
description: viewModel.companyProfileData!.id!,
),
TitleDescription(
title: ProfileStrings.registrationNumber,
description:
viewModel.companyProfileData!.registrationNumber!,
),
const TitleDescription(
title: ProfileStrings.businessType,
description: '-',
),
TitleDescription(
title: ProfileStrings.founded,
description:
viewModel.companyProfileData!.foundedYear!.toString(),
),
SizedBox(height: 24.0.h()),
// Theme Toggle
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(
ProfileStrings.settings,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
return SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(
currentIndex: 4, // Tenders index
),
SizedBox(
width: 740,
child: Column(
children: [
SizedBox(height: 36.0.h()),
TitleDescription(
title: ProfileStrings.companyName,
description: viewModel.companyProfileData!.name!,
),
TitleDescription(
title: ProfileStrings.nationalId,
description: viewModel.companyProfileData!.id!,
),
TitleDescription(
title: ProfileStrings.registrationNumber,
description:
viewModel.companyProfileData!.registrationNumber!,
),
const TitleDescription(
title: ProfileStrings.businessType,
description: '-',
),
TitleDescription(
title: ProfileStrings.founded,
description:
viewModel.companyProfileData!.foundedYear!.toString(),
),
SizedBox(height: 24.0.h()),
// Theme Toggle
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(
ProfileStrings.settings,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
),
),
SizedBox(height: 36.0.h()),
_themeChangeRow(),
SizedBox(height: 24.0.h()),
Divider(color: AppColors.dividerColor, thickness: 1),
SizedBox(height: 24.0.h()),
// Spacer(),
Align(
alignment: AlignmentDirectional.centerEnd,
child: InkWell(
onTap: () => viewModel.logout(),
borderRadius: BorderRadius.circular(100),
child: Container(
width: 156,
height: 56.0.h(),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
child: Text(
ProfileStrings.logout,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.primaryColor,
SizedBox(height: 36.0.h()),
_themeChangeRow(),
SizedBox(height: 24.0.h()),
Divider(color: AppColors.dividerColor, thickness: 1),
SizedBox(height: 24.0.h()),
// Spacer(),
Align(
alignment: AlignmentDirectional.centerEnd,
child: InkWell(
onTap: () => viewModel.logout(),
borderRadius: BorderRadius.circular(100),
child: Container(
width: 156,
height: 56.0.h(),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
child: Text(
ProfileStrings.logout,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.primaryColor,
),
),
),
),
),
),
],
],
),
),
),
],
],
),
);
},
),
+66 -64
View File
@@ -66,76 +66,78 @@ class _MobileProfilePageState extends State<MobileProfilePage> {
return const Center(child: Text(CommonStrings.noData));
}
return Padding(
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
vertical: 16.0.h(),
),
child: Column(
children: [
SizedBox(height: 36.0.h()),
TitleDescription(
title: ProfileStrings.companyName,
description: viewModel.companyProfileData!.name!,
),
TitleDescription(
title: ProfileStrings.nationalId,
description: viewModel.companyProfileData!.id!,
),
TitleDescription(
title: ProfileStrings.registrationNumber,
description:
viewModel.companyProfileData!.registrationNumber!,
),
const TitleDescription(
title: ProfileStrings.businessType,
description: '-',
),
TitleDescription(
title: ProfileStrings.founded,
description:
viewModel.companyProfileData!.foundedYear!.toString(),
),
SizedBox(height: 32.0.h()),
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(
ProfileStrings.settings,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
return SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
vertical: 16.0.h(),
),
child: Column(
children: [
SizedBox(height: 36.0.h()),
TitleDescription(
title: ProfileStrings.companyName,
description: viewModel.companyProfileData!.name!,
),
),
SizedBox(height: 36.0.h()),
_themeChangeRow(),
SizedBox(height: 24.0.h()),
Divider(color: AppColors.dividerColor, thickness: 1),
SizedBox(height: 24.0.h()),
const Spacer(),
InkWell(
onTap: () => viewModel.logout(),
borderRadius: BorderRadius.circular(100),
child: Container(
width: double.infinity,
height: 56.0.h(),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
TitleDescription(
title: ProfileStrings.nationalId,
description: viewModel.companyProfileData!.id!,
),
TitleDescription(
title: ProfileStrings.registrationNumber,
description:
viewModel.companyProfileData!.registrationNumber!,
),
const TitleDescription(
title: ProfileStrings.businessType,
description: '-',
),
TitleDescription(
title: ProfileStrings.founded,
description:
viewModel.companyProfileData!.foundedYear!.toString(),
),
SizedBox(height: 32.0.h()),
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(
ProfileStrings.logout,
ProfileStrings.settings,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.primaryColor,
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
),
),
],
SizedBox(height: 36.0.h()),
_themeChangeRow(),
SizedBox(height: 24.0.h()),
Divider(color: AppColors.dividerColor, thickness: 1),
SizedBox(height: 24.0.h()),
const Spacer(),
InkWell(
onTap: () => viewModel.logout(),
borderRadius: BorderRadius.circular(100),
child: Container(
width: double.infinity,
height: 56.0.h(),
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
child: Text(
ProfileStrings.logout,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.primaryColor,
),
),
),
),
],
),
),
);
},
+8 -8
View File
@@ -64,14 +64,14 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
return const Center(child: Text(CommonStrings.noData));
}
return SafeArea(
child: Scaffold(
key: key,
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
drawer: const TabletNavigationWidget(currentIndex: 4),
body: Padding(
return Scaffold(
key: key,
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
drawer: const TabletNavigationWidget(currentIndex: 4),
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
vertical: 16.0.h(),
+6 -4
View File
@@ -41,10 +41,12 @@ class _DesktopSplashPageState extends State<DesktopSplashPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 100),
child: Image.asset(AssetsManager.logoBigPng),
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 100),
child: Image.asset(AssetsManager.logoBigPng),
),
),
),
);
+6 -4
View File
@@ -53,10 +53,12 @@ class _MobileSplashPageState extends State<MobileSplashPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
child: Image.asset(AssetsManager.logoBigPng, fit: BoxFit.cover),
body: SafeArea(
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
child: Image.asset(AssetsManager.logoBigPng, fit: BoxFit.cover),
),
),
),
);
+6 -4
View File
@@ -41,10 +41,12 @@ class _TabletSplashPageState extends State<TabletSplashPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Image.asset(AssetsManager.logoBigPng),
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Image.asset(AssetsManager.logoBigPng),
),
),
),
);
+49 -47
View File
@@ -51,58 +51,60 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
body: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1),
SizedBox(height: 48.0.h()),
const _SearchBox(),
const _ActionButtons(),
Expanded(
child: Consumer<TendersViewModel>(
builder: (context, vm, child) {
if (vm.isLoading) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.jellyBean,
),
);
}
if (vm.errorMessage != null) {
return Center(child: Text(vm.errorMessage!));
}
final tenders = vm.tendersResponse?.data?.tenders ?? [];
if (tenders.isEmpty) {
return const Center(child: Text(CommonStrings.noData));
}
return Column(
children: [
Expanded(
child: SingleChildScrollView(
child: SizedBox(
width: 740,
height: 800,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 4.0.h()),
child: MainTendersSlider(
tenders: tenders,
isDesktop: true,
body: SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1),
SizedBox(height: 48.0.h()),
const _SearchBox(),
const _ActionButtons(),
Expanded(
child: Consumer<TendersViewModel>(
builder: (context, vm, child) {
if (vm.isLoading) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.jellyBean,
),
);
}
if (vm.errorMessage != null) {
return Center(child: Text(vm.errorMessage!));
}
final tenders = vm.tendersResponse?.data?.tenders ?? [];
if (tenders.isEmpty) {
return const Center(child: Text(CommonStrings.noData));
}
return Column(
children: [
Expanded(
child: SingleChildScrollView(
child: SizedBox(
width: 740,
height: 800,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 4.0.h()),
child: MainTendersSlider(
tenders: tenders,
isDesktop: true,
),
),
),
),
),
),
_DesktopPagination(
totalPages: vm.totalPages,
currentPage: vm.currentPage,
onPageSelected: vm.jumpToPage,
),
],
);
},
_DesktopPagination(
totalPages: vm.totalPages,
currentPage: vm.currentPage,
onPageSelected: vm.jumpToPage,
),
],
);
},
),
),
),
],
],
),
),
);
}
+6 -4
View File
@@ -60,10 +60,12 @@ class _MobileTendersPageState extends State<MobileTendersPage> {
return const Center(child: Text(CommonStrings.noData));
}
return Padding(
padding: EdgeInsets.symmetric(vertical: 18.0.h()),
child: MainTendersSlider(
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
return SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 18.0.h()),
child: MainTendersSlider(
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
),
),
);
},
+9 -7
View File
@@ -51,13 +51,15 @@ class _TabletTendersPageState extends State<TabletTendersPage> {
}
return Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsetsDirectional.only(
end: 24.0.w(),
top: 128.0.h(),
),
child: MainTendersSlider(
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
child: SafeArea(
child: Padding(
padding: EdgeInsetsDirectional.only(
end: 24.0.w(),
top: 128.0.h(),
),
child: MainTendersSlider(
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
),
),
),
),
@@ -39,88 +39,90 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
body: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1), // Tenders index
Expanded(
child: SizedBox(
width: 740,
child: Column(
children: [
SizedBox(height: 64.0.h()),
const TabletDesktopAppbar(
title: YourTendersStrings.yourTenders,
),
SizedBox(height: 20.0.h()),
const FilterButton(platformType: PlatformType.tabletDesktop),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data == null &&
viewModel.likedTendersData == null)) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
Widget content;
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: true,
isMobile: false,
);
} else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: true,
isMobile: false,
);
} else if (viewModel.data != null) {
content = TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: true,
isMobile: false,
);
} else {
content = const Center(
child: Text(YourTendersStrings.noTenders),
);
}
return Column(
children: [
Expanded(child: content),
SizedBox(height: 10.0.h()),
_listPagesControll(context, viewModel),
SizedBox(height: 30.0.h()),
],
);
},
body: SafeArea(
child: Column(
children: [
const DesktopNavigationWidget(currentIndex: 1), // Tenders index
Expanded(
child: SizedBox(
width: 740,
child: Column(
children: [
SizedBox(height: 64.0.h()),
const TabletDesktopAppbar(
title: YourTendersStrings.yourTenders,
),
),
],
SizedBox(height: 20.0.h()),
const FilterButton(platformType: PlatformType.tabletDesktop),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data == null &&
viewModel.likedTendersData == null)) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
Widget content;
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: true,
isMobile: false,
);
} else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: true,
isMobile: false,
);
} else if (viewModel.data != null) {
content = TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: true,
isMobile: false,
);
} else {
content = const Center(
child: Text(YourTendersStrings.noTenders),
);
}
return Column(
children: [
Expanded(child: content),
SizedBox(height: 10.0.h()),
_listPagesControll(context, viewModel),
SizedBox(height: 30.0.h()),
],
);
},
),
),
],
),
),
),
),
],
],
),
),
);
}
@@ -38,71 +38,73 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
appBar: appBar(context: context, title: YourTendersStrings.yourTenders),
body: Column(
children: [
const FilterButton(platformType: PlatformType.mobile),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.tenders ?? []).isEmpty &&
(viewModel.likedTendersData?.data?.feedback ?? [])
.isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
return Column(
children: [
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null)
Expanded(
child: LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: false,
isMobile: true,
),
)
else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null)
Expanded(
child: LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: false,
isMobile: true,
),
)
else if (viewModel.data != null)
Expanded(
child: TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: false,
isMobile: true,
),
)
else
const Expanded(
child: Center(
child: Text(YourTendersStrings.noTenders),
),
body: SafeArea(
child: Column(
children: [
const FilterButton(platformType: PlatformType.mobile),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data?.data?.tenders ?? []).isEmpty &&
(viewModel.likedTendersData?.data?.feedback ?? [])
.isEmpty) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
],
);
},
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
return Column(
children: [
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null)
Expanded(
child: LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: false,
isMobile: true,
),
)
else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null)
Expanded(
child: LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: false,
isMobile: true,
),
)
else if (viewModel.data != null)
Expanded(
child: TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: false,
isMobile: true,
),
)
else
const Expanded(
child: Center(
child: Text(YourTendersStrings.noTenders),
),
),
],
);
},
),
),
),
],
],
),
),
);
}
@@ -44,84 +44,86 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(title: YourTendersStrings.yourTenders, key: key),
drawer: const TabletNavigationWidget(currentIndex: 1),
body: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
const SizedBox(height: 64.0),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
child: const TabletDesktopAppbar(
title: YourTendersStrings.yourTenders,
body: SafeArea(
child: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
const SizedBox(height: 64.0),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
child: const TabletDesktopAppbar(
title: YourTendersStrings.yourTenders,
),
),
),
SizedBox(height: 24.0.h()),
const FilterButton(platformType: PlatformType.tabletDesktop),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data == null &&
viewModel.likedTendersData == null)) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
SizedBox(height: 24.0.h()),
const FilterButton(platformType: PlatformType.tabletDesktop),
Expanded(
child: Consumer<YourTendersViewModel>(
builder: (context, viewModel, child) {
if (viewModel.isLoading &&
(viewModel.data == null &&
viewModel.likedTendersData == null)) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
Widget content;
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: false,
isMobile: false,
);
} else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: false,
isMobile: false,
);
} else if (viewModel.data != null) {
content = TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: false,
isMobile: false,
);
} else {
content = const Center(
child: Text(YourTendersStrings.noTenders),
);
}
return Column(
children: [
Expanded(child: content),
SizedBox(height: 10.0.h()),
_listPagesControll(context, viewModel),
const SizedBox(height: 30.0),
],
);
}
if (viewModel.errorMessage != null) {
return Center(child: Text(viewModel.errorMessage!));
}
Widget content;
if (viewModel.selectedStatus ==
YourTendersStrings.likeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.liked.value,
isDesktop: false,
isMobile: false,
);
} else if (viewModel.selectedStatus ==
YourTendersStrings.dislikeTenders &&
viewModel.likedTendersData != null) {
content = LikedDislikedTendersList(
data: viewModel.likedTendersData!,
status: TenderFeedback.disliked.value,
isDesktop: false,
isMobile: false,
);
} else if (viewModel.data != null) {
content = TendersSubmitted(
approvedTenders: viewModel.data!,
isDesktop: false,
isMobile: false,
);
} else {
content = const Center(
child: Text(YourTendersStrings.noTenders),
);
}
return Column(
children: [
Expanded(child: content),
SizedBox(height: 10.0.h()),
_listPagesControll(context, viewModel),
const SizedBox(height: 30.0),
],
);
},
},
),
),
),
],
],
),
),
),
),