fix home and tenders scrolling and no data problem in tenders

This commit is contained in:
amirrezaghabeli
2025-09-11 12:11:40 +03:30
parent 05eb2ac77c
commit 2e0ff88b75
5 changed files with 105 additions and 87 deletions
+56 -48
View File
@@ -16,56 +16,62 @@ class DesktopHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Consumer<HomeViewModel>(
builder: (context, homeViewModel, child) {
if (homeViewModel.isLoading) {
return const Center(
child: CircularProgressIndicator(color: AppColors.secondary50),
);
}
if (homeViewModel.errorMessage != null) {
return Center(child: Text(homeViewModel.errorMessage!));
}
if (homeViewModel.tenderApprovalsStateResponse != null &&
homeViewModel.data != null &&
homeViewModel.feedbackStats != null) {
return SingleChildScrollView(
child: Column(
children: [
DesktopNavigationWidget(
currentIndex: 0, // Home index
),
SizedBox(
width: 780,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
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),
],
body: Column(
children: [
DesktopNavigationWidget(
currentIndex: 0, // Home index
),
Expanded(
child: Consumer<HomeViewModel>(
builder: (context, homeViewModel, child) {
if (homeViewModel.isLoading) {
return const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
);
}
if (homeViewModel.errorMessage != null) {
return Center(child: Text(homeViewModel.errorMessage!));
}
if (homeViewModel.tenderApprovalsStateResponse != null &&
homeViewModel.data != null &&
homeViewModel.feedbackStats != null) {
return SingleChildScrollView(
child: SizedBox(
width: 780,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
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 const Center(
child: CircularProgressIndicator(
color: AppColors.secondary50,
),
],
),
);
}
return const Center(
child: CircularProgressIndicator(color: AppColors.secondary50),
);
},
);
},
),
),
],
),
);
}
@@ -81,6 +87,7 @@ class DesktopHomePage extends StatelessWidget {
amount: homeViewModel.partnershipPercent.toString(),
circularProgressIndicatorWidth: 176,
circularProgressIndicatorHeight: 176,
strokeWidth: 9,
),
SizedBox(width: 106),
ProgressBarColumn(
@@ -89,6 +96,7 @@ class DesktopHomePage extends StatelessWidget {
amount: homeViewModel.selfApplyPercent.toString(),
circularProgressIndicatorWidth: 176,
circularProgressIndicatorHeight: 176,
strokeWidth: 9,
),
],
);