mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
20 lines
389 B
Dart
20 lines
389 B
Dart
class Category {
|
|
int? id;
|
|
int? parentId;
|
|
String? name;
|
|
|
|
Category({this.id, this.parentId, this.name});
|
|
|
|
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
|
id: json['id'] as int?,
|
|
parentId: json['parent_id'] as int?,
|
|
name: json['name'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'id': id,
|
|
'parent_id': parentId,
|
|
'name': name,
|
|
};
|
|
}
|