Fixed pagination for your tenders in home
This commit is contained in:
@@ -169,7 +169,8 @@ class DesktopHomePage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||
final isYourTenders = homeViewModel.data?.data?.tenders!.isNotEmpty ?? false;
|
||||
final isYourTenders =
|
||||
homeViewModel.data?.data?.tenders!.isNotEmpty ?? false;
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 740),
|
||||
child: Align(
|
||||
@@ -190,16 +191,23 @@ class DesktopHomePage extends StatelessWidget {
|
||||
|
||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||
final controller = ScrollController();
|
||||
controller.addListener(() {
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
if (!homeViewModel.isRecommendedMode) {
|
||||
// YourTenders
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getYourTenders();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Recommended
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommendTenders();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
width: 740,
|
||||
|
||||
Reference in New Issue
Block a user