Update on image clicked in flutter quill extensions

pull/1657/head
Ellet 1 year ago
parent eb540cc038
commit 2cef5f5912
  1. 1
      CHANGELOG.md
  2. 35
      flutter_quill_extensions/lib/embeds/image/editor/image_embed.dart

@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## 9.1.2
* Require minimum version `6.0.0` of `flutter_keyboard_visibility` to fix some build issues with Android Gradle Plugin 8.2.0
* Add on image clicked in `flutter_quill_extensions` callback
## 9.1.1
* Require `super_clipboard` minimum version `0.8.1` to fix some bug with Linux build failure

@ -56,21 +56,26 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder {
QuillSharedExtensionsConfigurations.get(context: context)
.imageSaverService;
return GestureDetector(
onTap: configurations.onImageClicked != null
? () => configurations.onImageClicked!(imageSource)
: () => showDialog(
context: context,
builder: (_) => FlutterQuillLocalizationsWidget(
child: ImageOptionsMenu(
controller: controller,
configurations: configurations,
imageSource: imageSource,
imageSize: imageSize,
isReadOnly: readOnly,
imageSaverService: imageSaverService,
),
),
),
onTap: () {
final onImageClicked = configurations.onImageClicked;
if (onImageClicked != null) {
onImageClicked(imageSource);
return;
}
showDialog(
context: context,
builder: (_) => FlutterQuillLocalizationsWidget(
child: ImageOptionsMenu(
controller: controller,
configurations: configurations,
imageSource: imageSource,
imageSize: imageSize,
isReadOnly: readOnly,
imageSaverService: imageSaverService,
),
),
);
},
child: Builder(
builder: (context) {
if (margin != null) {

Loading…
Cancel
Save