CommentModel.fromJson constructor

CommentModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CommentModel.fromJson(Map<String, dynamic> json) {
  return CommentModel(
    text: json['text'],
    id: json['id'],
    createdAt: json['createdAt'],
    createdAtFromNow: DateTime.parse(json['createdAt']).fromNow(),
  );
}