Message.fromJson constructor

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

Creates a Message from JSON-like map data.

Implementation

factory Message.fromJson(Map<String, dynamic> json) {
  return Message(
    id: json['id'],
    user: User.fromJson(json['user']),
    userId: json['user_id'],
    content: json['content'],
    role: json['role'],
    flow: json['flow'],
    createdAt: json['createdAt'],
    updatedAt: json['updatedAt'],
    widgetDefination: json['widget_defination'],
    threadId: json['thread_id'],
  );
}