D1APP-48 data model edits

This commit is contained in:
MohammadTaha Basiri 2022-01-18 18:10:28 +03:30
parent b51f0b3d93
commit 58fd0680fe
2 changed files with 8 additions and 4 deletions

View File

@ -5,9 +5,9 @@ class NewsOverview {
final String description;
final String image;
final String createdAt;
final bool marked;
bool marked;
const NewsOverview({
NewsOverview({
required this.id,
required this.title,
required this.reference,

View File

@ -8,10 +8,11 @@ class RadarOverview {
final int timeToRead;
final String createdAt;
final bool forManagers;
final bool marked;
bool marked;
final List<Category> categories;
final int comments;
const RadarOverview({
RadarOverview({
required this.id,
required this.image,
required this.title,
@ -21,6 +22,7 @@ class RadarOverview {
required this.forManagers,
required this.marked,
required this.categories,
required this.comments,
});
factory RadarOverview.fromJson(Map<String, dynamic> json) => RadarOverview(
@ -32,6 +34,7 @@ class RadarOverview {
createdAt: json['createdAt'],
forManagers: json['forManagers'],
marked: json['marked'],
comments: json['comments'],
categories: List<Category>.from(
json['categories'].map(
(category) => Category.fromJson(category),
@ -48,6 +51,7 @@ class RadarOverview {
'createdAt': createdAt,
'forManagers': forManagers,
'marked': marked,
'comment': comments,
'categories': categories.map((e) => e.toJson()).toList(),
};
}