Add magnifierConfiguration

pull/1511/head
Ellet 1 year ago
parent d1950f0053
commit 614bf1a526
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 3
      flutter_quill_extensions/lib/logic/utils/quill_image_utils.dart
  2. 2
      flutter_quill_extensions/lib/presentation/embeds/editor/image/image.dart
  3. 9
      lib/src/models/config/editor/configurations.dart
  4. 5
      lib/src/widgets/raw_editor/raw_editor_render_object.dart
  5. 6
      lib/src/widgets/raw_editor/raw_editor_state.dart

@ -126,7 +126,7 @@ class QuillImageUtilities {
/// print('Error deleting local images: $e');
/// }
/// ```
Future<void> deleteAllLocalImagesOfDocument() async {
Future<void> deleteAllLocalImages() async {
_webIsNotSupported('deleteAllLocalImagesOfDocument');
final imagesPaths = getImagesPathsFromDocument(
onlyLocalImages: true,
@ -213,7 +213,6 @@ class QuillImageUtilities {
/// Returns `true` if the image is cached, `false` otherwise.
/// On other platforms it will always return false
static bool isImageCached(String imagePath) {
_webIsNotSupported('isImageCached');
// Determine if the image path is a cached path based on platform
if (kIsWeb) {
// For now this will not work for web

@ -218,7 +218,7 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder {
}
if (!readOnly || isImageBase64(imageUrl)) {
// To enforce using it on the web, desktop and other platforms
// To enforce using it on the desktop and other platforms
// and that is up to the developer
if (!base.isMobile() &&
configurations.forceUseMobileOptionMenuForImageClick) {

@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart' show Brightness, Uint8List, immutable;
import 'package:flutter/material.dart'
show TextCapitalization, TextSelectionThemeData;
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart' show experimental;
import '../../../widgets/default_styles.dart';
import '../../../widgets/delegate.dart';
@ -69,6 +70,7 @@ class QuillEditorConfigurations extends Equatable {
this.requestKeyboardFocusOnCheckListChanged = false,
this.elementOptions = const QuillEditorElementOptions(),
this.builder,
this.magnifierConfiguration,
});
/// The text placeholder in the quill editor
@ -310,6 +312,10 @@ class QuillEditorConfigurations extends Equatable {
final QuillEditorBuilder? builder;
/// Currently this feature is experimental
@experimental
final TextMagnifierConfiguration? magnifierConfiguration;
@override
List<Object?> get props => [
placeholder,
@ -362,6 +368,7 @@ class QuillEditorConfigurations extends Equatable {
bool? requestKeyboardFocusOnCheckListChanged,
QuillEditorElementOptions? elementOptions,
QuillEditorBuilder? builder,
TextMagnifierConfiguration? magnifierConfiguration,
}) {
return QuillEditorConfigurations(
placeholder: placeholder ?? this.placeholder,
@ -416,6 +423,8 @@ class QuillEditorConfigurations extends Equatable {
this.requestKeyboardFocusOnCheckListChanged,
elementOptions: elementOptions ?? this.elementOptions,
builder: builder ?? this.builder,
magnifierConfiguration:
magnifierConfiguration ?? this.magnifierConfiguration,
);
}
}

@ -5,9 +5,8 @@ import '../../models/documents/document.dart';
import '../cursor.dart';
import '../editor/editor.dart';
class QuilRawEditorMultiChildRenderObjectWidget
extends MultiChildRenderObjectWidget {
const QuilRawEditorMultiChildRenderObjectWidget({
class QuilRawEditorMultiChildRenderObject extends MultiChildRenderObjectWidget {
const QuilRawEditorMultiChildRenderObject({
required super.children,
required this.document,
required this.textDirection,

@ -47,10 +47,10 @@ import '../text_line.dart';
import '../text_selection.dart';
import 'raw_editor.dart';
import 'raw_editor_actions.dart';
import 'raw_editor_render_object.dart';
import 'raw_editor_state_selection_delegate_mixin.dart';
import 'raw_editor_state_text_input_client_mixin.dart';
import 'raw_editor_text_boundaries.dart';
import 'raw_editor_widget.dart';
class QuillRawEditorState extends EditorState
with
@ -245,7 +245,7 @@ class QuillRawEditorState extends EditorState
child: Semantics(
child: MouseRegion(
cursor: SystemMouseCursors.text,
child: QuilRawEditorMultiChildRenderObjectWidget(
child: QuilRawEditorMultiChildRenderObject(
key: _editorKey,
document: doc,
selection: controller.selection,
@ -286,7 +286,7 @@ class QuillRawEditorState extends EditorState
link: _toolbarLayerLink,
child: MouseRegion(
cursor: SystemMouseCursors.text,
child: QuilRawEditorMultiChildRenderObjectWidget(
child: QuilRawEditorMultiChildRenderObject(
key: _editorKey,
offset: offset,
document: doc,

Loading…
Cancel
Save