From a50f449f7ced0bf350e61c5ad78cde2f493268ce Mon Sep 17 00:00:00 2001 From: Kima Date: Mon, 7 Oct 2024 22:33:52 +0200 Subject: [PATCH] added extra fields in news objects --- refilc/lib/api/client.dart | 2 +- refilc/lib/models/news.dart | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/refilc/lib/api/client.dart b/refilc/lib/api/client.dart index c7a0dd0..db1ae6f 100644 --- a/refilc/lib/api/client.dart +++ b/refilc/lib/api/client.dart @@ -22,7 +22,7 @@ class FilcAPI { // Public API static const schoolList = "$baseUrl/v3/public/school-list"; - static const news = "$baseUrl/v3/public/news"; + static const news = "$baseUrl/v4/public/news"; static const supporters = "$baseUrl/v3/public/supporters"; // Private API diff --git a/refilc/lib/models/news.dart b/refilc/lib/models/news.dart index 05431d7..c2dd928 100644 --- a/refilc/lib/models/news.dart +++ b/refilc/lib/models/news.dart @@ -7,6 +7,8 @@ class News { String platform; bool emergency; DateTime expireDate; + List? appVersions; + String? specificAppId; Map? json; News({ @@ -18,6 +20,8 @@ class News { required this.platform, required this.emergency, required this.expireDate, + this.appVersions, + this.specificAppId, this.json, }); @@ -31,6 +35,10 @@ class News { platform: json["platform"] ?? "", emergency: json["emergency"] ?? false, expireDate: DateTime.parse(json["expire_date"] ?? ''), + appVersions: json["app_versions"] != null + ? List.from(json["app_versions"]) + : null, + specificAppId: json["specific_app_id"], json: json, ); }