From ce71bf97bcf9af9814002e2b1c3accdbcea38056 Mon Sep 17 00:00:00 2001 From: Ahmed Hnewa <73608287+freshtechtips@users.noreply.github.com> Date: Tue, 24 Oct 2023 19:13:53 +0300 Subject: [PATCH] Fixes for previous step --- CHANGELOG.md | 3 + .../lib/embeds/builders.dart | 4 - lib/flutter_quill.dart | 2 +- lib/src/widgets/editor/editor.dart | 24 ++-- lib/src/widgets/toolbar/enum.dart | 122 ------------------ lib/src/widgets/toolbar/toolbar.dart | 1 - pubspec.yaml | 2 +- 7 files changed, 14 insertions(+), 144 deletions(-) delete mode 100644 lib/src/widgets/toolbar/enum.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 4172b66f..0b931907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [7.10.1] +- Fixes and use the new parameters + ## [7.10.0] - **Breaking change**: `QuillToolbar.basic()` can be accessed from `QuillToolbar()` directly and the old `QuillToolbar` can be accessed from `QuillBaseToolbar` - The Quill editor and toolbar configurations are now refactored in one single class for each one diff --git a/flutter_quill_extensions/lib/embeds/builders.dart b/flutter_quill_extensions/lib/embeds/builders.dart index 5b3103f1..2492fd7c 100644 --- a/flutter_quill_extensions/lib/embeds/builders.dart +++ b/flutter_quill_extensions/lib/embeds/builders.dart @@ -416,10 +416,6 @@ Widget _menuOptionsForReadonlyImage({ onPressed: () { Navigator.pushReplacement( context, - // TODO: Consider add support for other theme system - // like Cupertino or at least add the option to by - // by using PageRoute as option so dev can ovveride this - // this change should be done in all places if you want to MaterialPageRoute( builder: (context) => ImageTapWrapper( imageUrl: imageUrl, diff --git a/lib/flutter_quill.dart b/lib/flutter_quill.dart index e8234cb2..1e74f5c7 100644 --- a/lib/flutter_quill.dart +++ b/lib/flutter_quill.dart @@ -1,6 +1,7 @@ library flutter_quill; export 'src/models/config/quill_configurations.dart'; +export 'src/models/config/toolbar/base_configurations.dart'; export 'src/models/documents/attribute.dart'; export 'src/models/documents/document.dart'; export 'src/models/documents/nodes/block.dart'; @@ -27,6 +28,5 @@ export 'src/widgets/embeds.dart'; export 'src/widgets/link.dart' show LinkActionPickerDelegate, LinkMenuAction; export 'src/widgets/style_widgets/style_widgets.dart'; export 'src/widgets/toolbar/base_toolbar.dart'; -export 'src/widgets/toolbar/enum.dart'; export 'src/widgets/toolbar/toolbar.dart'; export 'src/widgets/utils/provider.dart'; diff --git a/lib/src/widgets/editor/editor.dart b/lib/src/widgets/editor/editor.dart index 4bd43e1c..042b0d85 100644 --- a/lib/src/widgets/editor/editor.dart +++ b/lib/src/widgets/editor/editor.dart @@ -154,26 +154,20 @@ class QuillEditor extends StatefulWidget { /// The configurations for the quill editor widget of flutter quill QuillEditorConfigurations configurations = const QuillEditorConfigurations(), - TextSelectionThemeData? textSelectionThemeData, - Brightness? keyboardAppearance, - Iterable? embedBuilders, - EdgeInsetsGeometry padding = EdgeInsets.zero, - bool autoFocus = true, - bool expands = false, FocusNode? focusNode, - GlobalKey? editorKey, + ScrollController? scrollController, }) { return QuillEditor( - scrollController: ScrollController(), + scrollController: scrollController ?? ScrollController(), focusNode: focusNode ?? FocusNode(), configurations: configurations.copyWith( - textSelectionThemeData: textSelectionThemeData, - autoFocus: autoFocus, - expands: expands, - padding: padding, - keyboardAppearance: keyboardAppearance ?? Brightness.light, - embedBuilders: embedBuilders, - editorKey: editorKey, + textSelectionThemeData: configurations.textSelectionThemeData, + autoFocus: configurations.autoFocus, + expands: configurations.expands, + padding: configurations.padding, + keyboardAppearance: configurations.keyboardAppearance, + embedBuilders: configurations.embedBuilders, + editorKey: configurations.editorKey, ), ); } diff --git a/lib/src/widgets/toolbar/enum.dart b/lib/src/widgets/toolbar/enum.dart deleted file mode 100644 index 6f9e23a7..00000000 --- a/lib/src/widgets/toolbar/enum.dart +++ /dev/null @@ -1,122 +0,0 @@ -enum ToolbarButtons { - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - undo, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - redo, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - fontFamily, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - fontSize, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - bold, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - subscript, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - superscript, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - italic, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - small, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - underline, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - strikeThrough, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - inlineCode, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - color, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - backgroundColor, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - clearFormat, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - centerAlignment, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - leftAlignment, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - rightAlignment, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - justifyAlignment, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - direction, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - headerStyle, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - listNumbers, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - listBullets, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - listChecks, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - codeBlock, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - quote, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - indentIncrease, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - indentDecrease, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - link, - @Deprecated('Please customize the button in the QuillProvider. ' - 'You will find toolbarConfigurations and then buttons and pass a value' - ' and change what you want, the tooltip for spesefic button for example') - search, -} diff --git a/lib/src/widgets/toolbar/toolbar.dart b/lib/src/widgets/toolbar/toolbar.dart index 1ea5a15c..b9f85a11 100644 --- a/lib/src/widgets/toolbar/toolbar.dart +++ b/lib/src/widgets/toolbar/toolbar.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import '../../../flutter_quill.dart'; -import '../../models/config/toolbar/base_configurations.dart'; import '../../utils/extensions/build_context.dart'; class QuillToolbar extends StatelessWidget { diff --git a/pubspec.yaml b/pubspec.yaml index b6906df7..85f95b35 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. -version: 7.10.0 +version: 7.10.1 homepage: https://1o24bbs.com/c/bulletjournal/108 repository: https://github.com/singerdmx/flutter-quill topics: