fixed ad isBefore

This commit is contained in:
Kima 2023-09-05 21:55:51 +02:00
parent 4d501fed3e
commit bbbaea9224
4 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,14 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/kima/src/flutter
FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=4.2.0
FLUTTER_BUILD_NUMBER=220
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

View File

@ -18,6 +18,7 @@ class Ad {
});
factory Ad.fromJson(Map json) {
print(json);
return Ad(
title: json['title'] ?? 'Ad',
description: json['description'] ?? '',

View File

@ -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(

View File

@ -13,6 +13,9 @@ class AdTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
print('geic');
print(ad);
return Padding(
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0),
child: PanelButton(