FileMessage constructor

FileMessage({
  1. required String content,
  2. String? name,
  3. String? type,
  4. String? size,
})

Creates a new instance of FileMessage.

content is the actual data content of the file encoded in base64 format.

name is the name of the file.

type is the MIME type or content type of the file (e.g., text/plain).

size is the size of the file, represented as a string.

Implementation

FileMessage({
  required String content,
  String? name,
  String? type,
  String? size,
}) : super(
        type: MessageType.FILE,
        content: jsonEncode({
          'content': content,
          'name': name,
          'type': type,
          'size': size,
        }),
      );