1
This commit is contained in:
25
lib/api/dto/article_dto.dart
Normal file
25
lib/api/dto/article_dto.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
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"] ?? "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user