added Category

This commit is contained in:
shilangyu 2020-08-10 14:07:00 +00:00
parent cf59f9f2ae
commit e0a149f688
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import 'package:json_annotation/json_annotation.dart';
part 'category.g.dart';
/// based on https://github.com/LemmyNet/lemmy/blob/464ea862b10fa7b226b2550268e40d8e685a939c/server/lemmy_db/src/category.rs#L10
@JsonSerializable(fieldRename: FieldRename.snake, createToJson: false)
class Category {
final int id;
final String name;
const Category({
this.id,
this.name,
});
factory Category.fromJson(Map<String, dynamic> json) =>
_$CategoryFromJson(json);
}