MessageAttachment.fromJson constructor

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

Creates a MessageAttachment from JSON.

Implementation

factory MessageAttachment.fromJson(Map<String, dynamic> json) {
  return MessageAttachment(
    fileId: json['file_id'] as String,
    tools: (json['tools'] as List<dynamic>?)
        ?.map((e) => AttachmentTool.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}