58 lines
1.5 KiB
Dart
58 lines
1.5 KiB
Dart
import 'category.dart';
|
|
|
|
class RadarOverview {
|
|
final int id;
|
|
final String image;
|
|
final String title;
|
|
final String description;
|
|
final int timeToRead;
|
|
final String createdAt;
|
|
final bool forManagers;
|
|
bool marked;
|
|
final List<Category> categories;
|
|
final int comments;
|
|
|
|
RadarOverview({
|
|
required this.id,
|
|
required this.image,
|
|
required this.title,
|
|
required this.description,
|
|
required this.timeToRead,
|
|
required this.createdAt,
|
|
required this.forManagers,
|
|
required this.marked,
|
|
required this.categories,
|
|
required this.comments,
|
|
});
|
|
|
|
factory RadarOverview.fromJson(Map<String, dynamic> json) => RadarOverview(
|
|
id: json['id'],
|
|
image: json['image'],
|
|
title: json['title'],
|
|
description: json['description'],
|
|
timeToRead: json['timeToRead'],
|
|
createdAt: json['createdAt'],
|
|
forManagers: json['forManagers'],
|
|
marked: json['marked'],
|
|
comments: json['comments'],
|
|
categories: List<Category>.from(
|
|
json['categories'].map(
|
|
(category) => Category.fromJson(category),
|
|
),
|
|
),
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'id': id,
|
|
'image': image,
|
|
'title': title,
|
|
'description': description,
|
|
'timeToRead': timeToRead,
|
|
'createdAt': createdAt,
|
|
'forManagers': forManagers,
|
|
'marked': marked,
|
|
'comment': comments,
|
|
'categories': categories.map((e) => e.toJson()).toList(),
|
|
};
|
|
}
|