mediaUploadInterceptor property

(FutureOr<bool> Function(PlatformFile, InsertFileType)?) mediaUploadInterceptor
final

Allows you to intercept any image/video/audio files being inserted into the editor. The function passes the PlatformFile class, which contains all the file data including name, size, type, Uint8List bytes, etc.

Return a bool to tell the plugin if it should continue with its own handler or if you want to handle the image/video/audio upload by yourself. (true = continue with internal handler, false = do not use internal handler)

If no interceptor is set, the plugin uses the internal handler.

Implementation

final FutureOr<bool> Function(PlatformFile, InsertFileType)? mediaUploadInterceptor;