flutter-quill
flutter-quill copied to clipboard
onImageRemovedCallback not called when Image is Removed with a keystroke(backspace)
Is there an existing issue for this?
- [X] I have searched the existing issues
The question
I am trying to delete an image from file system when an image is removed from the editor. Overriding the callback onImageRemovedCallback
appears to work only when image is removed by clicking on the 'Remove' option on the image actions popup. However, when image is removed by clicking backspace key on the keyboard, the callback is not fired. How can I fix this?
Here is the call back code:
QuillEditorImageEmbedConfigurations imageEmbedConfigurations = QuillEditorImageEmbedConfigurations(
onImageRemovedCallback: (imageUrl) async {
final file = File(imageUrl);
if (await file.exists()) {
await file.delete();
print('File deleted successfully');
} else {
print('File does not exist');
}
},
);