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 json) => _$CommentFromJson(json); Map toJson() => _$CommentToJson(this); }