26 lines
450 B
Dart
26 lines
450 B
Dart
class ArticleDto {
|
|
int? id;
|
|
String? title;
|
|
String? subtitle;
|
|
|
|
ArticleDto({
|
|
this.id,
|
|
this.title,
|
|
this.subtitle,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map["id"] = id;
|
|
map["title"] = title;
|
|
map["subtitle"] = subtitle;
|
|
return map;
|
|
}
|
|
|
|
ArticleDto.fromJson(dynamic json) {
|
|
id = json["id"] ?? 0;
|
|
title = json["title"] ?? "";
|
|
subtitle = json["subtitle"] ?? "";
|
|
}
|
|
}
|