ads api working

This commit is contained in:
Kima
2023-09-05 21:08:06 +02:00
parent b6eb65814f
commit 2cba1ec286
5 changed files with 35 additions and 6 deletions

View File

@@ -5,14 +5,16 @@ class Ad {
Uri? logoUrl;
bool overridePremium;
DateTime date;
Uri launchUrl;
Ad({
required this.title,
required this.description,
required this.author,
required this.logoUrl,
this.logoUrl,
this.overridePremium = false,
required this.date,
required this.launchUrl,
});
factory Ad.fromJson(Map json) {
@@ -24,6 +26,7 @@ class Ad {
overridePremium: json['override_premium'] ?? false,
date:
json['date'] != null ? DateTime.parse(json['date']) : DateTime.now(),
launchUrl: Uri.parse(json['launch_url'] ?? 'https://refilc.hu'),
);
}
}