fixed some bug
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -195,10 +195,12 @@ class MobileHomePage extends StatelessWidget {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ class TabletHomePage extends StatelessWidget {
|
||||
SizedBox(height: 8.0.h()),
|
||||
//_secondTenderCardsRow(homeViewModel.homeResponse!),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(),
|
||||
_yourTenderText(homeViewModel),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
@@ -192,9 +192,10 @@ class TabletHomePage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _yourTenderText() {
|
||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
||||
return Text(
|
||||
AppStrings.recommendation,
|
||||
isYourTenders ? AppStrings.yourTenders : AppStrings.recommendedTenders,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0.sp(),
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -206,14 +207,17 @@ class TabletHomePage 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();
|
||||
}
|
||||
controller.addListener(() {
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 387.0.h(),
|
||||
|
||||
Reference in New Issue
Block a user