Update _defaultOnTapOutside

pull/1518/head
Ellet 1 year ago
parent ffc2992002
commit 5c67d9c4d3
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 8
      flutter_quill_extensions/lib/presentation/models/config/editor/image/image.dart
  2. 1
      lib/src/utils/platform.dart
  3. 4
      lib/src/widgets/raw_editor/raw_editor_state.dart

@ -112,6 +112,10 @@ class QuillEditorImageEmbedConfigurations {
static ImageEmbedBuilderOnRemovedCallback get defaultOnImageRemovedCallback {
return (imageUrl) async {
if (isWeb()) {
return;
}
final mobile = isMobile(supportWeb: false);
// If the platform is not mobile, return void;
// Since the mobile OS gives us a copy of the image
@ -134,10 +138,6 @@ class QuillEditorImageEmbedConfigurations {
// it without
// permission
if (isWeb()) {
return;
}
final dartIoImageFile = File(imageUrl);
final isFileExists = await dartIoImageFile.exists();

@ -4,6 +4,7 @@ import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart'
show kIsWeb, TargetPlatform, defaultTargetPlatform;
/// If you want to override the [kIsWeb] use [overrideIsWeb]
bool isWeb({bool? overrideIsWeb}) {
return overrideIsWeb ?? kIsWeb;
}

@ -185,10 +185,6 @@ class QuillRawEditorState extends EditorState
}
void _defaultOnTapOutside(PointerDownEvent event) {
if (isWeb()) {
widget.focusNode.unfocus();
}
/// The focus dropping behavior is only present on desktop platforms
/// and mobile browsers.
switch (defaultTargetPlatform) {

Loading…
Cancel
Save