|
|
|
|
@ -21,13 +21,13 @@ class AdsListWidget extends StatelessWidget {
|
|
|
|
|
final ScrollPhysics? scrollPhysics;
|
|
|
|
|
final bool isAdsFragment;
|
|
|
|
|
final bool shouldShowAdStatus;
|
|
|
|
|
final Function() onFetchMoreAds;
|
|
|
|
|
final Function()? onFetchMoreAds;
|
|
|
|
|
|
|
|
|
|
const AdsListWidget({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.adsList,
|
|
|
|
|
required this.shouldShowAdStatus,
|
|
|
|
|
required this.onFetchMoreAds,
|
|
|
|
|
this.onFetchMoreAds,
|
|
|
|
|
this.scrollPhysics,
|
|
|
|
|
this.isAdsFragment = false,
|
|
|
|
|
});
|
|
|
|
|
@ -44,7 +44,9 @@ class AdsListWidget extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
return NotificationListener<ScrollNotification>(
|
|
|
|
|
onNotification: (ScrollNotification scrollInfo) {
|
|
|
|
|
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent && context.read<AdVM>().hasMoreData) {
|
|
|
|
|
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent && context
|
|
|
|
|
.read<AdVM>()
|
|
|
|
|
.hasMoreData) {
|
|
|
|
|
log("should call more ads api:");
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
@ -102,7 +104,9 @@ class AdCard extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (isAdsFragment && !context.read<AdVM>().isExploreAdsTapped) ...[
|
|
|
|
|
if (isAdsFragment && !context
|
|
|
|
|
.read<AdVM>()
|
|
|
|
|
.isExploreAdsTapped) ...[
|
|
|
|
|
Utils.statusContainerChip(text: adDetails.statuslabel!, chipColor: Utils.getChipColorByAdStatus(adDetails.adPostStatus!)),
|
|
|
|
|
],
|
|
|
|
|
(adDetails.vehicle!.vehicleTitle ?? "").toText(
|
|
|
|
|
|