model updates
This commit is contained in:
parent
bd8e9b08bb
commit
97d36abfdd
|
|
@ -3,7 +3,7 @@ import 'reply.dart';
|
|||
import 'user.dart';
|
||||
|
||||
class CommentData {
|
||||
final int id;
|
||||
int id;
|
||||
final String text;
|
||||
final String createdAt;
|
||||
final bool liked;
|
||||
|
|
|
|||
|
|
@ -5,14 +5,15 @@ class ItemOverview {
|
|||
final String title;
|
||||
final String image;
|
||||
final String description;
|
||||
final int timeToRead;
|
||||
final String reference;
|
||||
final bool forManagers;
|
||||
final int? timeToRead;
|
||||
final String? reference;
|
||||
final bool? forManagers;
|
||||
final String createdAt;
|
||||
final String type;
|
||||
final List<Category> categories;
|
||||
final String? type;
|
||||
final List<Category>? categories;
|
||||
int? comments;
|
||||
|
||||
const ItemOverview({
|
||||
ItemOverview({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.image,
|
||||
|
|
@ -23,6 +24,7 @@ class ItemOverview {
|
|||
required this.createdAt,
|
||||
required this.type,
|
||||
required this.categories,
|
||||
required this.comments,
|
||||
});
|
||||
|
||||
factory ItemOverview.fromJson(Map<String, dynamic> json) => ItemOverview(
|
||||
|
|
@ -35,11 +37,14 @@ class ItemOverview {
|
|||
forManagers: json['forManagers'],
|
||||
createdAt: json['createdAt'],
|
||||
type: json['type'],
|
||||
categories: List<Category>.from(
|
||||
json['categories'].map(
|
||||
(cat) => Category.fromJson(cat),
|
||||
),
|
||||
),
|
||||
comments: json['comments'],
|
||||
categories: json['categories'] == null
|
||||
? null
|
||||
: List<Category>.from(
|
||||
json['categories'].map(
|
||||
(cat) => Category.fromJson(cat),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
|
@ -52,6 +57,6 @@ class ItemOverview {
|
|||
'forManagers': forManagers,
|
||||
'createdAt': createdAt,
|
||||
'type': type,
|
||||
'categories': categories.map((e) => e.toJson()).toList(),
|
||||
'categories': categories?.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ class NewsDetailsData {
|
|||
final String image;
|
||||
final String createdAt;
|
||||
final bool marked;
|
||||
final int comments;
|
||||
int comments;
|
||||
final int order;
|
||||
final List<Tag> tags;
|
||||
final List<Content> contents;
|
||||
|
||||
const NewsDetailsData({
|
||||
NewsDetailsData({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.reference,
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ class RadarDetailsData {
|
|||
final String? podcast;
|
||||
final bool forManagers;
|
||||
final bool marked;
|
||||
final int comments;
|
||||
int comments;
|
||||
final List<Tag> tags;
|
||||
final List<Content> contents;
|
||||
final List<Category> categories;
|
||||
final int order;
|
||||
|
||||
const RadarDetailsData({
|
||||
RadarDetailsData({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.image,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class RadarOverview {
|
|||
final bool forManagers;
|
||||
bool marked;
|
||||
final List<Category> categories;
|
||||
final int comments;
|
||||
int comments;
|
||||
|
||||
RadarOverview({
|
||||
required this.id,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class RadarRequestArgs {
|
|||
final String? startDate;
|
||||
final String? endDate;
|
||||
final String? search;
|
||||
final bool? isSingleItem;
|
||||
|
||||
const RadarRequestArgs({
|
||||
required this.page,
|
||||
|
|
@ -11,5 +12,6 @@ class RadarRequestArgs {
|
|||
this.startDate,
|
||||
this.endDate,
|
||||
this.search,
|
||||
this.isSingleItem,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue