encode method

  1. @override
Future<Map<String, dynamic>> encode(
  1. dynamic content
)
override

Implementation

@override
Future<Map<String, dynamic>> encode(dynamic content) async {
  if (content is! AttachmentContent) {
    throw const FormatException('Content must be AttachmentContent');
  }
  return {
    'content': content.data,
    'parameters': {
      'filename': content.filename,
      'mimeType': content.mimeType,
      if (content.description != null) 'description': content.description!,
    }
  };
}