23 lines
541 B
Dart
23 lines
541 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'comment.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class Comment {
|
|
final String id;
|
|
final String postId;
|
|
final String content;
|
|
final String authorName;
|
|
final String authorImageUrl;
|
|
|
|
Comment({
|
|
required this.id,
|
|
required this.postId,
|
|
required this.content,
|
|
required this.authorName,
|
|
required this.authorImageUrl,
|
|
});
|
|
|
|
factory Comment.fromJson(Map<String, dynamic> json) => _$CommentFromJson(json);
|
|
Map<String, dynamic> toJson() => _$CommentToJson(this);
|
|
} |