uploadAttachment method

  1. @override
Future<ZendeskAttachment?> uploadAttachment({
  1. required String fileName,
  2. required String filePath,
  3. required String mimeType,
})
override

Upload an attachment and get its token.

  • fileName: The original file name
  • filePath: Absolute path to the file on the device
  • mimeType: The MIME type of the file (e.g., "image/png")

Returns a ZendeskAttachment with the upload token.

Implementation

@override
Future<ZendeskAttachment?> uploadAttachment({
  required String fileName,
  required String filePath,
  required String mimeType,
}) async {
  final result = await methodChannel.invokeMethod<Map>(
    'uploadAttachment',
    {
      'fileName': fileName,
      'filePath': filePath,
      'mimeType': mimeType,
    },
  );
  if (result == null) return null;
  return ZendeskAttachment.fromMap(Map<String, dynamic>.from(result));
}