added extra fields in news objects
This commit is contained in:
parent
fe3ed31830
commit
a50f449f7c
@ -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
|
||||
|
@ -7,6 +7,8 @@ class News {
|
||||
String platform;
|
||||
bool emergency;
|
||||
DateTime expireDate;
|
||||
List<String>? 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<String>.from(json["app_versions"])
|
||||
: null,
|
||||
specificAppId: json["specific_app_id"],
|
||||
json: json,
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user