fixed some bug

This commit is contained in:
llsajjad
2025-08-25 15:23:39 +03:30
parent c54bdbe4f7
commit b0d5a23a9a
6 changed files with 185 additions and 92 deletions
+76 -55
View File
@@ -27,24 +27,35 @@ class DesktopHomePage extends StatelessWidget {
return Center(child: Text(homeViewModel.errorMessage!));
}
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
SizedBox(height: 40.0),
_progressBarsRow(homeViewModel.tenderApprovalsStateResponse!),
SizedBox(height: 32.0.h()),
_firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
return Center(
child: SizedBox(
width: 780,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 55),
// SizedBox(width: 780, child: NotificationCard()),
SizedBox(height: 40.0),
_progressBarsRow(
homeViewModel.tenderApprovalsStateResponse!,
),
SizedBox(height: 32.0.h()),
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
child: _firstTenderCardsRow(
context,
homeViewModel.tenderApprovalsStateResponse!,
),
),
SizedBox(height: 32.0.h()),
_yourTenderText(homeViewModel),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
),
SizedBox(height: 32.0.h()),
_yourTenderText(),
SizedBox(height: 8.0.h()),
_bottomListView(homeViewModel),
],
),
),
);
},
@@ -81,7 +92,7 @@ class DesktopHomePage extends StatelessWidget {
circularProgressIndicatorWidth: 176,
circularProgressIndicatorHeight: 176,
),
SizedBox(width: 106),
//SizedBox(width: 106),
// ProgressBarColumn(
// text: AppStrings.contracting,
// value: double.parse(homeResponse.contracting ?? '0'),
@@ -100,39 +111,44 @@ class DesktopHomePage extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TenderCard(
backgroundColor: AppColors.primary20,
iconPath: 'assets/icons/arrows.svg',
title: AppStrings.tenderSubmitted,
amount: tenderApprovalsStateResponse.data!.approvedTenders.toString(),
// tenderApprovalsStateResponse
// .data!
// .approvalsBySubmission!
// .selfApply
// .toString(),
textColor: Color(0xFF0164FF),
enableTap: true,
width: 178,
height: 148,
onTap: () {
YourTendersRouteData().push(context);
},
Expanded(
child: TenderCard(
backgroundColor: AppColors.primary20,
iconPath: 'assets/icons/arrows.svg',
title: AppStrings.tenderSubmitted,
amount:
tenderApprovalsStateResponse.data!.approvedTenders.toString(),
// tenderApprovalsStateResponse
// .data!
// .approvalsBySubmission!
// .selfApply
// .toString(),
textColor: Color(0xFF0164FF),
enableTap: true,
width: 178,
height: 148,
onTap: () {
YourTendersRouteData().push(context);
},
),
),
SizedBox(width: 10),
TenderCard(
backgroundColor: AppColors.primary10,
iconPath: 'assets/icons/thumb.svg',
title: AppStrings.approvedTenders,
amount: '0',
textColor: Color(0xFF24848E),
enableTap: true,
width: 178,
height: 148,
onTap: () {
YourTendersRouteData().push(context);
},
Expanded(
child: TenderCard(
backgroundColor: AppColors.primary10,
iconPath: 'assets/icons/thumb.svg',
title: AppStrings.approvedTenders,
amount: '0',
textColor: Color(0xFF24848E),
enableTap: true,
width: 178,
height: 148,
onTap: () {
YourTendersRouteData().push(context);
},
),
),
SizedBox(width: 10),
// SizedBox(width: 10),
// TenderCard(
// backgroundColor: AppColors.orange10,
// iconPath: 'assets/icons/shield.svg',
@@ -160,13 +176,16 @@ class DesktopHomePage extends StatelessWidget {
);
}
Widget _yourTenderText() {
Widget _yourTenderText(HomeViewModel homeViewModel) {
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: 740),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
AppStrings.recommendation,
isYourTenders
? AppStrings.yourTenders
: AppStrings.recommendedTenders,
style: TextStyle(
fontSize: 18.0.sp(),
fontWeight: FontWeight.w700,
@@ -179,15 +198,17 @@ class DesktopHomePage extends StatelessWidget {
Widget _bottomListView(HomeViewModel homeViewModel) {
final controller = ScrollController();
controller.addListener(() {
if (controller.position.pixels >=
controller.position.maxScrollExtent - 200) {
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
homeViewModel.getHomeRecommandTenders();
if (homeViewModel.isRecommendedMode) {
if (controller.position.pixels >=
controller.position.maxScrollExtent - 200) {
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
homeViewModel.getHomeRecommandTenders();
}
}
}
});
return SizedBox(
width: 740,
height: 387.0,