D1APP-48 deta model edits

This commit is contained in:
MohammadTaha Basiri 2022-01-20 18:22:10 +03:30
parent 08a2de5751
commit 0958f98894
2 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@ class NewsDetailsData {
final String createdAt; final String createdAt;
final bool marked; final bool marked;
final int comments; final int comments;
final int order;
final List<Tag> tags; final List<Tag> tags;
final List<Content> contents; final List<Content> contents;
@ -22,6 +23,7 @@ class NewsDetailsData {
required this.comments, required this.comments,
required this.tags, required this.tags,
required this.contents, required this.contents,
required this.order,
}); });
factory NewsDetailsData.fromJson(Map<String, dynamic> json) { factory NewsDetailsData.fromJson(Map<String, dynamic> json) {
@ -33,6 +35,7 @@ class NewsDetailsData {
createdAt: json['createdAt'], createdAt: json['createdAt'],
marked: json['marked'], marked: json['marked'],
comments: json['comments'], comments: json['comments'],
order: json['order'],
tags: List<Tag>.from(json['tags'].map((tag) => Tag.fromJson(tag))), tags: List<Tag>.from(json['tags'].map((tag) => Tag.fromJson(tag))),
contents: List<Content>.from(json['contents'].map( contents: List<Content>.from(json['contents'].map(
(content) => Content.fromJson(content), (content) => Content.fromJson(content),
@ -43,6 +46,7 @@ class NewsDetailsData {
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'id': id, 'id': id,
'title': title, 'title': title,
'order': order,
'reference': reference, 'reference': reference,
'image': image, 'image': image,
'createdAt': createdAt, 'createdAt': createdAt,

View File

@ -16,6 +16,7 @@ class RadarDetailsData {
final List<Tag> tags; final List<Tag> tags;
final List<Content> contents; final List<Content> contents;
final List<Category> categories; final List<Category> categories;
final int order;
const RadarDetailsData({ const RadarDetailsData({
required this.id, required this.id,
@ -30,6 +31,7 @@ class RadarDetailsData {
required this.tags, required this.tags,
required this.contents, required this.contents,
required this.categories, required this.categories,
required this.order,
}); });
factory RadarDetailsData.fromJson(Map<String, dynamic> json) { factory RadarDetailsData.fromJson(Map<String, dynamic> json) {
@ -42,6 +44,7 @@ class RadarDetailsData {
podcast: json['podcast'], podcast: json['podcast'],
forManagers: json['forManagers'], forManagers: json['forManagers'],
marked: json['marked'], marked: json['marked'],
order: json['order'],
comments: json['comments'], comments: json['comments'],
tags: List<Tag>.from(json['tags'].map((tag) => Tag.fromJson(tag))), tags: List<Tag>.from(json['tags'].map((tag) => Tag.fromJson(tag))),
contents: List<Content>.from( contents: List<Content>.from(
@ -66,6 +69,7 @@ class RadarDetailsData {
'podcast': podcast, 'podcast': podcast,
'forManagers': forManagers, 'forManagers': forManagers,
'marked': marked, 'marked': marked,
'order': order,
'comments': comments, 'comments': comments,
'tags': tags.map((e) => e.toJson()).toList(), 'tags': tags.map((e) => e.toJson()).toList(),
'contents': contents.map((e) => e.toJson()).toList(), 'contents': contents.map((e) => e.toJson()).toList(),