From cfe31db202f1b843fca246cf705b384d17b0b1ff Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 10 Jan 2024 17:00:46 +0000 Subject: [PATCH] quill update part 1 --- .../pages/components/quill_editor_demo.dart | 10 +- example/lib/pages/quill_editor_demo.dart | 9 +- .../flutter/generated_plugin_registrant.cc | 12 +- example/linux/flutter/generated_plugins.cmake | 3 +- .../Flutter/GeneratedPluginRegistrant.swift | 6 +- example/macos/Podfile.lock | 28 +- example/pubspec.yaml | 1 + .../flutter/generated_plugin_registrant.cc | 9 +- .../windows/flutter/generated_plugins.cmake | 3 +- .../organisms/quill_editor/html_parser.dart | 2 +- .../organisms/quill_editor/quill_delta.dart | 1 + .../organisms/quill_editor/quill_editor.dart | 22 +- .../quill_editor/quill_editor_page.dart | 45 +- .../organisms/quill_editor/quill_toolbar.dart | 791 +++++++++--------- lib/zds_flutter.dart | 2 +- pubspec.yaml | 6 +- 16 files changed, 507 insertions(+), 443 deletions(-) diff --git a/example/lib/pages/components/quill_editor_demo.dart b/example/lib/pages/components/quill_editor_demo.dart index 654e791..c836e32 100644 --- a/example/lib/pages/components/quill_editor_demo.dart +++ b/example/lib/pages/components/quill_editor_demo.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_quill/flutter_quill.dart'; +// import 'package:flutter_quill/flutter_quill.dart'; import 'package:zds_flutter/zds_flutter.dart'; ///Example for htmlEditor @@ -45,9 +47,11 @@ class _QuillEditorDemoState extends State { children: [ Expanded( child: QuillEditor.basic( - padding: const EdgeInsets.all(16), - controller: controller, - readOnly: true, + configurations: QuillEditorConfigurations( + padding: const EdgeInsets.all(16), + controller: controller, + readOnly: true, + ), ), ), ], diff --git a/example/lib/pages/quill_editor_demo.dart b/example/lib/pages/quill_editor_demo.dart index f64492d..7f88a98 100644 --- a/example/lib/pages/quill_editor_demo.dart +++ b/example/lib/pages/quill_editor_demo.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_quill/flutter_quill.dart'; import 'package:zds_flutter/zds_flutter.dart'; ///Example for htmlEditor @@ -67,10 +68,12 @@ class _QuillEditorDemoState extends State { children: [ Expanded( child: QuillEditor.basic( - padding: const EdgeInsets.all(16), - controller: controller, + configurations: QuillEditorConfigurations( + padding: const EdgeInsets.all(16), + controller: controller, + readOnly: true, + ), focusNode: FocusNode(canRequestFocus: false), - readOnly: true, ), ), ], diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index 158f759..9876374 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -7,16 +7,20 @@ #include "generated_plugin_registrant.h" #include -#include +#include +#include #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); - g_autoptr(FlPluginRegistrar) pasteboard_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin"); - pasteboard_plugin_register_with_registrar(pasteboard_registrar); + g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin"); + irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar); + g_autoptr(FlPluginRegistrar) super_native_extensions_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "SuperNativeExtensionsPlugin"); + super_native_extensions_plugin_register_with_registrar(super_native_extensions_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 93c755e..8aff642 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -4,7 +4,8 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux - pasteboard + irondash_engine_context + super_native_extensions url_launcher_linux ) diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 78434d1..c0af230 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,11 +9,12 @@ import device_info_plus import file_selector_macos import flutter_image_compress_macos import flutter_inappwebview_macos +import irondash_engine_context import package_info_plus -import pasteboard import path_provider_foundation import shared_preferences_foundation import sqflite +import super_native_extensions import url_launcher_macos import video_compress import video_player_avfoundation @@ -24,11 +25,12 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) + IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin")) FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index ce348d6..48a9781 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -5,13 +5,17 @@ PODS: - FlutterMacOS - flutter_image_compress_macos (1.0.0): - FlutterMacOS + - flutter_inappwebview_macos (0.0.1): + - FlutterMacOS + - OrderedSet (~> 5.0) - FlutterMacOS (1.0.0) - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) - - package_info_plus (0.0.1): + - irondash_engine_context (0.0.1): - FlutterMacOS - - pasteboard (0.0.1): + - OrderedSet (5.0.0) + - package_info_plus (0.0.1): - FlutterMacOS - path_provider_foundation (0.0.1): - Flutter @@ -22,6 +26,8 @@ PODS: - sqflite (0.0.2): - FlutterMacOS - FMDB (>= 2.7.5) + - super_native_extensions (0.0.1): + - FlutterMacOS - url_launcher_macos (0.0.1): - FlutterMacOS - video_compress (0.3.0): @@ -36,12 +42,14 @@ DEPENDENCIES: - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - flutter_image_compress_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_image_compress_macos/macos`) + - flutter_inappwebview_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) + - irondash_engine_context (from `Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - - pasteboard (from `Flutter/ephemeral/.symlinks/plugins/pasteboard/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) + - super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - video_compress (from `Flutter/ephemeral/.symlinks/plugins/video_compress/macos`) - video_player_avfoundation (from `Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin`) @@ -50,6 +58,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - FMDB + - OrderedSet EXTERNAL SOURCES: device_info_plus: @@ -58,18 +67,22 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos flutter_image_compress_macos: :path: Flutter/ephemeral/.symlinks/plugins/flutter_image_compress_macos/macos + flutter_inappwebview_macos: + :path: Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos FlutterMacOS: :path: Flutter/ephemeral + irondash_engine_context: + :path: Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos package_info_plus: :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos - pasteboard: - :path: Flutter/ephemeral/.symlinks/plugins/pasteboard/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin shared_preferences_foundation: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin sqflite: :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos + super_native_extensions: + :path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos video_compress: @@ -83,13 +96,16 @@ SPEC CHECKSUMS: device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9 flutter_image_compress_macos: c26c3c13ea0f28ae6dea4e139b3292e7729f99f1 + flutter_inappwebview_macos: 9600c9df9fdb346aaa8933812009f8d94304203d FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478 + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce - pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea + super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3 url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 video_compress: c896234f100791b5fef7f049afa38f6d2ef7b42f video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 80ea669..ee33d08 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: shared_preferences: ^2.2.2 zds_flutter: path: ../ + flutter_quill: ^9.2.2 flutter: uses-material-design: true diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 183168b..6c8aac7 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -7,17 +7,20 @@ #include "generated_plugin_registrant.h" #include -#include +#include #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); - PasteboardPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PasteboardPlugin")); + IrondashEngineContextPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi")); PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); + SuperNativeExtensionsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 69289a8..2187214 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -4,8 +4,9 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows - pasteboard + irondash_engine_context permission_handler_windows + super_native_extensions url_launcher_windows ) diff --git a/lib/src/components/organisms/quill_editor/html_parser.dart b/lib/src/components/organisms/quill_editor/html_parser.dart index e8600bc..7e45f3e 100644 --- a/lib/src/components/organisms/quill_editor/html_parser.dart +++ b/lib/src/components/organisms/quill_editor/html_parser.dart @@ -4,7 +4,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:flutter_quill/flutter_quill.dart'; +import 'package:flutter_quill/quill_delta.dart'; import '../../../../zds_flutter.dart'; diff --git a/lib/src/components/organisms/quill_editor/quill_delta.dart b/lib/src/components/organisms/quill_editor/quill_delta.dart index a79ec13..898ba78 100644 --- a/lib/src/components/organisms/quill_editor/quill_delta.dart +++ b/lib/src/components/organisms/quill_editor/quill_delta.dart @@ -1,5 +1,6 @@ // ignore_for_file: avoid_dynamic_calls import 'package:flutter_quill/flutter_quill.dart'; +import 'package:flutter_quill/quill_delta.dart'; import 'package:vsc_quill_delta_to_html/vsc_quill_delta_to_html.dart'; import 'html_parser.dart'; diff --git a/lib/src/components/organisms/quill_editor/quill_editor.dart b/lib/src/components/organisms/quill_editor/quill_editor.dart index 0183c00..63afc06 100644 --- a/lib/src/components/organisms/quill_editor/quill_editor.dart +++ b/lib/src/components/organisms/quill_editor/quill_editor.dart @@ -1,6 +1,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart'; + +import '../../../../zds_flutter.dart'; import 'quill_toolbar.dart'; /// A custom widget for the Quill editor. @@ -76,16 +78,18 @@ class ZdsQuillEditor extends StatelessWidget { Widget build(BuildContext context) { // Base editor configuration final editor = QuillEditor.basic( - controller: controller, - readOnly: readOnly, - keyboardAppearance: keyboardAppearance, - embedBuilders: embedBuilders, - padding: padding, - autoFocus: autoFocus, - expands: expands, + configurations: QuillEditorConfigurations( + controller: controller, + readOnly: readOnly, + keyboardAppearance: keyboardAppearance ?? Brightness.light, + embedBuilders: embedBuilders, + padding: padding, + autoFocus: autoFocus, + expands: expands, + placeholder: placeholder, + editorKey: editorKey, + ), focusNode: readOnly ? FocusNode(canRequestFocus: false) : focusNode, - placeholder: placeholder, - editorKey: editorKey, ); // If readOnly, return just editor diff --git a/lib/src/components/organisms/quill_editor/quill_editor_page.dart b/lib/src/components/organisms/quill_editor/quill_editor_page.dart index 551df59..01147f2 100644 --- a/lib/src/components/organisms/quill_editor/quill_editor_page.dart +++ b/lib/src/components/organisms/quill_editor/quill_editor_page.dart @@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_quill/flutter_quill.dart' as quill; +import 'package:flutter_quill/quill_delta.dart'; import '../../../../zds_flutter.dart'; import 'quill_toolbar.dart'; @@ -286,7 +287,7 @@ class _ZdsQuillEditorState extends State with FrameCallbackM /// Sets the editor's content from a plain text source. Future _setText(String initialText) async { - await initialText.toDelta().then((quill.Delta delta) { + await initialText.toDelta().then((Delta delta) { _quillController.document = quill.Document.fromDelta(delta); }); } @@ -337,14 +338,20 @@ class _ZdsQuillEditorState extends State with FrameCallbackM onPressed: null, child: ClipRRect( borderRadius: BorderRadius.circular(30), - child: quill.ClearFormatButton( - icon: Icons.format_clear, - iconSize: 30, - controller: _quillController, - iconTheme: quill.QuillIconTheme( - iconSelectedColor: Theme.of(context).colorScheme.onSecondary, - iconUnselectedFillColor: Colors.transparent, + child: quill.QuillToolbarClearFormatButton( + options: quill.QuillToolbarClearFormatButtonOptions( + iconData: Icons.format_clear, + iconSize: 30, + iconTheme: quill.QuillIconTheme( + iconButtonSelectedData: quill.IconButtonData( + color: Theme.of(context).colorScheme.onSecondary, + ), + iconButtonUnselectedData: const quill.IconButtonData( + color: Colors.transparent, + ), + ), ), + controller: _quillController, ), ), ), @@ -537,16 +544,24 @@ class _HistoryButtonState extends State<_HistoryButton> { widget.controller.changes.listen((quill.DocChange event) async { _setIconColor(); }); - - return quill.QuillIconButton( - highlightElevation: 0, - hoverElevation: 0, - size: widget.iconSize * kIconButtonFactor, - icon: Icon(widget.icon, size: widget.iconSize, color: _iconColor), - fillColor: Colors.transparent, + return quill.QuillToolbarIconButton( onPressed: _changeHistory, + icon: Icon( + widget.icon, + size: widget.iconSize * kIconButtonFactor, + color: _iconColor, + ), + isSelected: false, + iconTheme: const quill.QuillIconTheme(), afterPressed: widget.afterPressed, ); + // return quill.QuillToolbarHistoryButton(controller: controller, isUndo: isUndo) + + // return quill.QuillIconButton( + // highlightElevation: 0, + // hoverElevation: 0, + // fillColor: Colors.transparent, + // ); } void _setIconColor() { diff --git a/lib/src/components/organisms/quill_editor/quill_toolbar.dart b/lib/src/components/organisms/quill_editor/quill_toolbar.dart index 3added7..cf81b25 100644 --- a/lib/src/components/organisms/quill_editor/quill_toolbar.dart +++ b/lib/src/components/organisms/quill_editor/quill_toolbar.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart'; -import 'package:flutter_quill/translations.dart'; /// enum for toolbar position /// @@ -96,21 +95,24 @@ class ZdsQuillToolbar extends QuillToolbar { ///Constructor const ZdsQuillToolbar({ - super.children = const [], - super.axis, - super.toolbarSize, - super.toolbarSectionSpacing, - super.toolbarIconAlignment, - super.toolbarIconCrossAlignment, - super.multiRowsDisplay, - super.color, - super.customButtons, - super.locale, - super.afterButtonPressed, - super.sectionDividerColor, - super.sectionDividerSpace, - super.linkDialogAction, + super.configurations, + required super.child, super.key, + // super.children = const [], + // super.axis, + // super.toolbarSize, + // super.toolbarSectionSpacing, + // super.toolbarIconAlignment, + // super.toolbarIconCrossAlignment, + // super.multiRowsDisplay, + // super.color, + // super.customButtons, + // super.locale, + // super.afterButtonPressed, + // super.sectionDividerColor, + // super.sectionDividerSpace, + // super.linkDialogAction, + // super.key, }) : super(); /// Custom constructor for [ZdsQuillToolbar] @@ -154,11 +156,12 @@ class ZdsQuillToolbar extends QuillToolbar { showSuperscript: false, showSearchButton: false, multiRowsDisplay: false, - iconTheme: QuillIconTheme( - iconSelectedFillColor: theme.secondary, - iconUnselectedFillColor: theme.surface, - iconUnselectedColor: theme.onSurface, - ), + iconTheme: const QuillIconTheme( + // size: widget.iconSize * kIconButtonFactor, + // iconSelectedFillColor: theme.secondary, + // iconUnselectedFillColor: theme.surface, + // iconUnselectedColor: theme.onSurface, + ), ); } @@ -202,7 +205,7 @@ class ZdsQuillToolbar extends QuillToolbar { bool showSearchButton = true, bool showSubscript = true, bool showSuperscript = true, - List customButtons = const [], + List customButtons = const [], /// Toolbar items to display for controls of embed blocks List? embedButtons, @@ -230,7 +233,7 @@ class ZdsQuillToolbar extends QuillToolbar { ///``` /// /// To disable tooltips just pass empty map as well. - Map? tooltips, + Map? tooltips, /// The locale to use for the editor toolbar, defaults to system locale /// More at https://github.com/singerdmx/flutter-quill#translation @@ -289,381 +292,387 @@ class ZdsQuillToolbar extends QuillToolbar { // }; //default button tooltips - final Map buttonTooltips = tooltips ?? - { - ToolbarButtons.undo: 'Undo'.i18n, - ToolbarButtons.redo: 'Redo'.i18n, - ToolbarButtons.fontFamily: 'Font family'.i18n, - ToolbarButtons.fontSize: 'Font size'.i18n, - ToolbarButtons.bold: 'Bold'.i18n, - ToolbarButtons.subscript: 'Subscript'.i18n, - ToolbarButtons.superscript: 'Superscript'.i18n, - ToolbarButtons.italic: 'Italic'.i18n, - ToolbarButtons.small: 'Small'.i18n, - ToolbarButtons.underline: 'Underline'.i18n, - ToolbarButtons.strikeThrough: 'Strike through'.i18n, - ToolbarButtons.inlineCode: 'Inline code'.i18n, - ToolbarButtons.color: 'Font color'.i18n, - ToolbarButtons.backgroundColor: 'Background color'.i18n, - ToolbarButtons.clearFormat: 'Clear format'.i18n, - ToolbarButtons.leftAlignment: 'Align left'.i18n, - ToolbarButtons.centerAlignment: 'Align center'.i18n, - ToolbarButtons.rightAlignment: 'Align right'.i18n, - ToolbarButtons.justifyAlignment: 'Justify win width'.i18n, - ToolbarButtons.direction: 'Text direction'.i18n, - ToolbarButtons.headerStyle: 'Header style'.i18n, - ToolbarButtons.listNumbers: 'Numbered list'.i18n, - ToolbarButtons.listBullets: 'Bullet list'.i18n, - ToolbarButtons.listChecks: 'Checked list'.i18n, - ToolbarButtons.codeBlock: 'Code block'.i18n, - ToolbarButtons.quote: 'Quote'.i18n, - ToolbarButtons.indentIncrease: 'Increase indent'.i18n, - ToolbarButtons.indentDecrease: 'Decrease indent'.i18n, - ToolbarButtons.link: 'Insert URL'.i18n, - ToolbarButtons.search: 'Search'.i18n, - }; + // final Map buttonTooltips = tooltips ?? + // { + // QuillToolbarOption.undo: 'Undo'.i18n, + // QuillToolbarOption.redo: 'Redo'.i18n, + // QuillToolbarOption.fontFamily: 'Font family'.i18n, + // QuillToolbarOption.fontSize: 'Font size'.i18n, + // QuillToolbarOption.bold: 'Bold'.i18n, + // QuillToolbarOption.subscript: 'Subscript'.i18n, + // QuillToolbarOption.superscript: 'Superscript'.i18n, + // QuillToolbarOption.italic: 'Italic'.i18n, + // QuillToolbarOption.small: 'Small'.i18n, + // QuillToolbarOption.underline: 'Underline'.i18n, + // QuillToolbarOption.strikeThrough: 'Strike through'.i18n, + // QuillToolbarOption.inlineCode: 'Inline code'.i18n, + // QuillToolbarOption.color: 'Font color'.i18n, + // QuillToolbarOption.backgroundColor: 'Background color'.i18n, + // QuillToolbarOption.clearFormat: 'Clear format'.i18n, + // QuillToolbarOption.leftAlignment: 'Align left'.i18n, + // QuillToolbarOption.centerAlignment: 'Align center'.i18n, + // QuillToolbarOption.rightAlignment: 'Align right'.i18n, + // QuillToolbarOption.justifyAlignment: 'Justify win width'.i18n, + // QuillToolbarOption.direction: 'Text direction'.i18n, + // QuillToolbarOption.headerStyle: 'Header style'.i18n, + // QuillToolbarOption.listNumbers: 'Numbered list'.i18n, + // QuillToolbarOption.listBullets: 'Bullet list'.i18n, + // QuillToolbarOption.listChecks: 'Checked list'.i18n, + // QuillToolbarOption.codeBlock: 'Code block'.i18n, + // QuillToolbarOption.quote: 'Quote'.i18n, + // QuillToolbarOption.indentIncrease: 'Increase indent'.i18n, + // QuillToolbarOption.indentDecrease: 'Decrease indent'.i18n, + // QuillToolbarOption.link: 'Insert URL'.i18n, + // QuillToolbarOption.search: 'Search'.i18n, + // }; return ZdsQuillToolbar( key: key, - axis: axis, - color: color, - toolbarSize: toolbarIconSize * 2, - toolbarSectionSpacing: toolbarSectionSpacing, - toolbarIconAlignment: toolbarIconAlignment, - toolbarIconCrossAlignment: toolbarIconCrossAlignment, - multiRowsDisplay: multiRowsDisplay, - customButtons: customButtons, - locale: locale, - afterButtonPressed: afterButtonPressed, - children: [ - if (showUndo) - HistoryButton( - icon: Icons.undo_outlined, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.undo], - controller: controller, - undo: true, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showRedo) ...[ - HistoryButton( - icon: Icons.redo_outlined, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.redo], - controller: controller, - undo: false, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers) QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - ], - if (showHeaderStyle) ...[ - SelectHeaderStyleButton( - tooltip: buttonTooltips[ToolbarButtons.headerStyle], - controller: controller, - axis: axis, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers) QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - ], - if (showBoldButton) - ToggleStyleButton( - attribute: Attribute.bold, - icon: Icons.format_bold, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.bold], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showSubscript) - ToggleStyleButton( - attribute: Attribute.subscript, - icon: Icons.subscript, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.subscript], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showSuperscript) - ToggleStyleButton( - attribute: Attribute.superscript, - icon: Icons.superscript, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.superscript], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showItalicButton) - ToggleStyleButton( - attribute: Attribute.italic, - icon: Icons.format_italic, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.italic], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showUnderLineButton) - ToggleStyleButton( - attribute: Attribute.underline, - icon: Icons.format_underline, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.underline], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showStrikeThrough) - ToggleStyleButton( - attribute: Attribute.strikeThrough, - icon: Icons.format_strikethrough, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.strikeThrough], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showSmallButton) - ToggleStyleButton( - attribute: Attribute.small, - icon: Icons.format_size, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.small], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showInlineCode) - ToggleStyleButton( - attribute: Attribute.inlineCode, - icon: Icons.code, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.inlineCode], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers) QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showColorButton) - ColorButton( - icon: Icons.color_lens, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.color], - controller: controller, - background: false, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showBackgroundColorButton) - ColorButton( - icon: Icons.format_color_fill, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.backgroundColor], - controller: controller, - background: true, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showClearFormat) - ClearFormatButton( - icon: Icons.format_clear, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.clearFormat], - controller: controller, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (embedButtons != null) - for (final EmbedButtonBuilder builder in embedButtons) - builder(controller, toolbarIconSize, iconTheme, dialogTheme), - if (showDividers && - isButtonGroupShown[0] && - (isButtonGroupShown[1] || - isButtonGroupShown[2] || - isButtonGroupShown[3] || - isButtonGroupShown[4] || - isButtonGroupShown[5])) - QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showAlignmentButtons) - SelectAlignmentButton( - controller: controller, - tooltips: Map.of(buttonTooltips) - ..removeWhere( - (ToolbarButtons key, String value) => ![ - ToolbarButtons.leftAlignment, - ToolbarButtons.centerAlignment, - ToolbarButtons.rightAlignment, - ToolbarButtons.justifyAlignment, - ].contains(key), - ), - iconSize: toolbarIconSize, - iconTheme: iconTheme, - showLeftAlignment: showLeftAlignment, - showCenterAlignment: showCenterAlignment, - showRightAlignment: showRightAlignment, - showJustifyAlignment: showJustifyAlignment, - afterButtonPressed: afterButtonPressed, - ), - if (showDirection) - ToggleStyleButton( - attribute: Attribute.rtl, - tooltip: buttonTooltips[ToolbarButtons.direction], - controller: controller, - icon: Icons.format_textdirection_r_to_l, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers && - isButtonGroupShown[1] && - (isButtonGroupShown[2] || isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) - QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showDividers && - showHeaderStyle && - isButtonGroupShown[2] && - (isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) - QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showListNumbers) - ToggleStyleButton( - attribute: Attribute.ol, - tooltip: buttonTooltips[ToolbarButtons.listNumbers], - controller: controller, - icon: Icons.format_list_numbered, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showListBullets) - ToggleStyleButton( - attribute: Attribute.ul, - tooltip: buttonTooltips[ToolbarButtons.listBullets], - controller: controller, - icon: Icons.format_list_bulleted, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showListCheck) - ToggleCheckListButton( - attribute: Attribute.unchecked, - tooltip: buttonTooltips[ToolbarButtons.listChecks], - controller: controller, - icon: Icons.check_box, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showCodeBlock) - ToggleStyleButton( - attribute: Attribute.codeBlock, - tooltip: buttonTooltips[ToolbarButtons.codeBlock], - controller: controller, - icon: Icons.code_off, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers && isButtonGroupShown[3] && (isButtonGroupShown[4] || isButtonGroupShown[5])) - QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showQuote) - ToggleStyleButton( - attribute: Attribute.blockQuote, - tooltip: buttonTooltips[ToolbarButtons.quote], - controller: controller, - icon: Icons.format_quote, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showIndent) - IndentButton( - icon: Icons.format_indent_increase, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.indentIncrease], - controller: controller, - isIncrease: true, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showIndent) - IndentButton( - icon: Icons.format_indent_decrease, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.indentDecrease], - controller: controller, - isIncrease: false, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - ), - if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5]) - QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - if (showLink) - LinkStyleButton( - tooltip: buttonTooltips[ToolbarButtons.link], - controller: controller, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - dialogTheme: dialogTheme, - afterButtonPressed: afterButtonPressed, - linkRegExp: linkRegExp, - linkDialogAction: linkDialogAction, - ), - if (showSearchButton) - SearchButton( - icon: Icons.search, - iconSize: toolbarIconSize, - tooltip: buttonTooltips[ToolbarButtons.search], - controller: controller, - iconTheme: iconTheme, - dialogTheme: dialogTheme, - afterButtonPressed: afterButtonPressed, - ), - // if (showFontFamily) - // QuillFontFamilyButton( - // iconTheme: iconTheme, - // iconSize: toolbarIconSize, - // tooltip: buttonTooltips[ToolbarButtons.fontFamily], - // attribute: Attribute.font, - // controller: controller, - // rawItemsMap: fontFamilies, - // afterButtonPressed: afterButtonPressed, - // ), - // if (showFontSize) - // QuillFontSizeButton( - // iconTheme: iconTheme, - // iconSize: toolbarIconSize, - // tooltip: buttonTooltips[ToolbarButtons.fontSize], - // attribute: Attribute.size, - // controller: controller, - // rawItemsMap: fontSizes, - // afterButtonPressed: afterButtonPressed, - // ), - if (customButtons.isNotEmpty) - if (showDividers) QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), - for (final QuillCustomButton customButton in customButtons) - if (customButton.child != null) ...[ - InkWell( - onTap: customButton.onTap, - child: customButton.child, + // axis: axis, + // color: color, + // toolbarSize: toolbarIconSize * 2, + // toolbarSectionSpacing: toolbarSectionSpacing, + // toolbarIconAlignment: toolbarIconAlignment, + // toolbarIconCrossAlignment: toolbarIconCrossAlignment, + // multiRowsDisplay: multiRowsDisplay, + // customButtons: customButtons, + // locale: locale, + // afterButtonPressed: afterButtonPressed, + child: Row( + children: [ + if (showUndo) + QuillToolbarHistoryButton( + // icon: Icons.undo_outlined, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.undo], + controller: controller, + isUndo: true, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, ), - ] else ...[ - CustomButton( - onPressed: customButton.onTap, - icon: customButton.icon, - iconColor: customButton.iconColor, - iconSize: toolbarIconSize, - iconTheme: iconTheme, - afterButtonPressed: afterButtonPressed, - tooltip: customButton.tooltip, + if (showRedo) ...[ + QuillToolbarHistoryButton( + // icon: Icons.redo_outlined, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.redo], + controller: controller, + isUndo: false, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showDividers) QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + ], + if (showHeaderStyle) ...[ + QuillToolbarSelectHeaderStyleButtons( + controller: controller, + // tooltip: buttonTooltips[ToolbarButtons.headerStyle], + // axis: axis, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, ), + if (showDividers) QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), ], - ], + if (showBoldButton) + QuillToolbarToggleStyleButton( + attribute: Attribute.bold, + // icon: Icons.format_bold, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.bold], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showSubscript) + QuillToolbarToggleStyleButton( + attribute: Attribute.subscript, + // icon: Icons.subscript, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.subscript], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showSuperscript) + QuillToolbarToggleStyleButton( + attribute: Attribute.superscript, + // icon: Icons.superscript, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.superscript], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showItalicButton) + QuillToolbarToggleStyleButton( + attribute: Attribute.italic, + // icon: Icons.format_italic, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.italic], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showUnderLineButton) + QuillToolbarToggleStyleButton( + attribute: Attribute.underline, + // icon: Icons.format_underline, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.underline], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showStrikeThrough) + QuillToolbarToggleStyleButton( + attribute: Attribute.strikeThrough, + // icon: Icons.format_strikethrough, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.strikeThrough], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showSmallButton) + QuillToolbarToggleStyleButton( + attribute: Attribute.small, + // icon: Icons.format_size, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.small], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showInlineCode) + QuillToolbarToggleStyleButton( + attribute: Attribute.inlineCode, + // icon: Icons.code, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.inlineCode], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showDividers) QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showColorButton) + QuillToolbarColorButton( + // icon: Icons.color_lens, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.color], + controller: controller, + isBackground: false, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showBackgroundColorButton) + QuillToolbarColorButton( + // icon: Icons.format_color_fill, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.backgroundColor], + controller: controller, + isBackground: true, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showClearFormat) + QuillToolbarClearFormatButton( + // icon: Icons.format_clear, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.clearFormat], + controller: controller, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (embedButtons != null) + for (final EmbedButtonBuilder builder in embedButtons) + builder(controller, toolbarIconSize, iconTheme, dialogTheme), + if (showDividers && + isButtonGroupShown[0] && + (isButtonGroupShown[1] || + isButtonGroupShown[2] || + isButtonGroupShown[3] || + isButtonGroupShown[4] || + isButtonGroupShown[5])) + QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showAlignmentButtons) + QuillToolbarSelectAlignmentButton( + controller: controller, + // tooltips: Map.of(buttonTooltips) + // ..removeWhere( + // (ToolbarButtons key, String value) => ![ + // ToolbarButtons.leftAlignment, + // ToolbarButtons.centerAlignment, + // ToolbarButtons.rightAlignment, + // ToolbarButtons.justifyAlignment, + // ].contains(key), + // ), + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // showLeftAlignment: showLeftAlignment, + // showCenterAlignment: showCenterAlignment, + // showRightAlignment: showRightAlignment, + // showJustifyAlignment: showJustifyAlignment, + // afterButtonPressed: afterButtonPressed, + ), + if (showDirection) + QuillToolbarToggleStyleButton( + attribute: Attribute.rtl, + // tooltip: buttonTooltips[ToolbarButtons.direction], + controller: controller, + // icon: Icons.format_textdirection_r_to_l, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showDividers && + isButtonGroupShown[1] && + (isButtonGroupShown[2] || isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) + QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showDividers && + showHeaderStyle && + isButtonGroupShown[2] && + (isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) + QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showListNumbers) + QuillToolbarToggleStyleButton( + attribute: Attribute.ol, + // tooltip: buttonTooltips[ToolbarButtons.listNumbers], + controller: controller, + // icon: Icons.format_list_numbered, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showListBullets) + QuillToolbarToggleStyleButton( + attribute: Attribute.ul, + // tooltip: buttonTooltips[ToolbarButtons.listBullets], + controller: controller, + // icon: Icons.format_list_bulleted, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showListCheck) + QuillToolbarToggleCheckListButton( + // attribute: Attribute.unchecked, + // tooltip: buttonTooltips[ToolbarButtons.listChecks], + controller: controller, + // icon: Icons.check_box, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showCodeBlock) + QuillToolbarToggleStyleButton( + attribute: Attribute.codeBlock, + // tooltip: buttonTooltips[ToolbarButtons.codeBlock], + controller: controller, + // icon: Icons.code_off, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showDividers && isButtonGroupShown[3] && (isButtonGroupShown[4] || isButtonGroupShown[5])) + QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showQuote) + QuillToolbarToggleStyleButton( + attribute: Attribute.blockQuote, + // tooltip: buttonTooltips[ToolbarButtons.quote], + controller: controller, + // icon: Icons.format_quote, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showIndent) + QuillToolbarIndentButton( + // icon: Icons.format_indent_increase, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.indentIncrease], + controller: controller, + isIncrease: true, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showIndent) + QuillToolbarIndentButton( + // icon: Icons.format_indent_decrease, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.indentDecrease], + controller: controller, + isIncrease: false, + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + ), + if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5]) + QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + if (showLink) + QuillToolbarLinkStyleButton( + // tooltip: buttonTooltips[ToolbarButtons.link], + controller: controller, + // iconSize: toolbarIconSize, + // iconTheme: iconTheme, + // dialogTheme: dialogTheme, + // afterButtonPressed: afterButtonPressed, + // linkRegExp: linkRegExp, + // linkDialogAction: linkDialogAction, + ), + if (showSearchButton) + QuillToolbarSearchButton( + // icon: Icons.search, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.search], + controller: controller, + // iconTheme: iconTheme, + // dialogTheme: dialogTheme, + // afterButtonPressed: afterButtonPressed, + ), + // if (showFontFamily) + // QuillFontFamilyButton( + // iconTheme: iconTheme, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.fontFamily], + // attribute: Attribute.font, + // controller: controller, + // rawItemsMap: fontFamilies, + // afterButtonPressed: afterButtonPressed, + // ), + // if (showFontSize) + // QuillFontSizeButton( + // iconTheme: iconTheme, + // iconSize: toolbarIconSize, + // tooltip: buttonTooltips[ToolbarButtons.fontSize], + // attribute: Attribute.size, + // controller: controller, + // rawItemsMap: fontSizes, + // afterButtonPressed: afterButtonPressed, + // ), + if (customButtons.isNotEmpty) + if (showDividers) QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + for (final QuillToolbarCustomButton customButton in customButtons) + if (customButton != null) ...[ + InkWell( + // onTap: customButton.onTap, + // child: customButton.child, + ), + ] else ...[ + QuillToolbarCustomButton( + controller: controller, + // options: QuillToolbarCustomButtonOptions( + // onPressed: customButton.onTap, + // icon: customButton.icon, + // // iconColor: customButton.iconColor, + // // iconSize: toolbarIconSize, + + // iconTheme: iconTheme, + // afterButtonPressed: afterButtonPressed, + // tooltip: customButton.tooltip, + // ), + ), + ], + ], + ), ); } } diff --git a/lib/zds_flutter.dart b/lib/zds_flutter.dart index 9e1a16c..45910d3 100644 --- a/lib/zds_flutter.dart +++ b/lib/zds_flutter.dart @@ -11,5 +11,5 @@ export 'src/utils/localizations.dart'; export 'src/utils/theme.dart'; export 'src/utils/tools.dart'; -/// Name of package ttttttttt +/// Name of package const String packageName = 'zds_flutter'; diff --git a/pubspec.yaml b/pubspec.yaml index b40a597..1aa9184 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ platforms: environment: sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.7.0" + flutter: ">=3.16.0" dependencies: cached_network_image: ^3.2.1 @@ -25,7 +25,7 @@ dependencies: csslib: ^0.17.3 dropdown_button2: ^2.1.4 expand_tap_area: ^1.1.0 - extended_image: ^8.1.0 + extended_image: ^8.2.0 file_picker: ^6.1.1 flutter: sdk: flutter @@ -39,7 +39,7 @@ dependencies: flutter_layout_grid: ^2.0.5 flutter_localizations: sdk: flutter - flutter_quill: 7.4.16 + flutter_quill: ^9.2.2 flutter_slidable: ^3.0.0 flutter_svg: ^2.0.7 flutter_swipe_action_cell: ^3.0.2