fixed ad isBefore
This commit is contained in:
@@ -18,6 +18,7 @@ class Ad {
|
||||
});
|
||||
|
||||
factory Ad.fromJson(Map json) {
|
||||
print(json);
|
||||
return Ad(
|
||||
title: json['title'] ?? 'Ad',
|
||||
description: json['description'] ?? '',
|
||||
|
||||
@@ -8,7 +8,7 @@ List<DateWidget> getWidgets(List<Ad> providerAds) {
|
||||
|
||||
if (providerAds.isNotEmpty) {
|
||||
for (var ad in providerAds) {
|
||||
if (ad.date.isAfter(DateTime.now())) {
|
||||
if (ad.date.isBefore(DateTime.now())) {
|
||||
providerAds.sort((a, b) => -a.date.compareTo(b.date));
|
||||
|
||||
items.add(DateWidget(
|
||||
|
||||
Reference in New Issue
Block a user