diff --git a/example/lib/pages/components/quill_editor_demo.dart b/example/lib/pages/components/quill_editor_demo.dart index c836e32..7f88a98 100644 --- a/example/lib/pages/components/quill_editor_demo.dart +++ b/example/lib/pages/components/quill_editor_demo.dart @@ -1,6 +1,5 @@ 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 @@ -27,7 +26,29 @@ class _QuillEditorDemoState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('Quill Editor')), + appBar: AppBar( + title: const Text('Quill Editor'), + actions: [ + IconButton( + icon: const Icon(Icons.html), + onPressed: () { + showDialog( + context: context, + builder: (context) { + return ConstrainedBox( + constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.7), + child: Dialog( + child: ZdsCard( + child: Text(ZdsQuillDelta(document: controller.document).toHtml()), + ), + ), + ); + }, + ); + }, + ), + ], + ), floatingActionButton: FloatingActionButton( child: const Icon(Icons.edit), onPressed: () { @@ -35,7 +56,7 @@ class _QuillEditorDemoState extends State { context, title: 'Edit Notes', initialDelta: ZdsQuillDelta(document: controller.document), - charLimit: 200, + charLimit: 20000, ).then((value) { if (value != null) { controller.document = value.document; @@ -52,6 +73,7 @@ class _QuillEditorDemoState extends State { controller: controller, readOnly: true, ), + focusNode: FocusNode(canRequestFocus: false), ), ), ], diff --git a/example/lib/pages/quill_editor_demo.dart b/example/lib/pages/quill_editor_demo.dart deleted file mode 100644 index 7f88a98..0000000 --- a/example/lib/pages/quill_editor_demo.dart +++ /dev/null @@ -1,83 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_quill/flutter_quill.dart'; -import 'package:zds_flutter/zds_flutter.dart'; - -///Example for htmlEditor -class QuillEditorDemo extends StatefulWidget { - const QuillEditorDemo({super.key}); - - @override - State createState() => _QuillEditorDemoState(); -} - -class _QuillEditorDemoState extends State { - final controller = QuillController.basic(); - - @override - void initState() { - super.initState(); - ZdsQuillDelta.fromHtml(''' -

H1 heading

H2 Heading

H3 Heading

Normal
Because

- ''').then((value) { - controller.document = value.document; - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Quill Editor'), - actions: [ - IconButton( - icon: const Icon(Icons.html), - onPressed: () { - showDialog( - context: context, - builder: (context) { - return ConstrainedBox( - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.7), - child: Dialog( - child: ZdsCard( - child: Text(ZdsQuillDelta(document: controller.document).toHtml()), - ), - ), - ); - }, - ); - }, - ), - ], - ), - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.edit), - onPressed: () { - ZdsQuillEditorPage.edit( - context, - title: 'Edit Notes', - initialDelta: ZdsQuillDelta(document: controller.document), - charLimit: 20000, - ).then((value) { - if (value != null) { - controller.document = value.document; - } - }); - }, - ), - body: Column( - children: [ - Expanded( - child: QuillEditor.basic( - configurations: QuillEditorConfigurations( - padding: const EdgeInsets.all(16), - controller: controller, - readOnly: true, - ), - focusNode: FocusNode(canRequestFocus: false), - ), - ), - ], - ), - ); - } -} diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index c0af230..80d5f73 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,6 +9,7 @@ import device_info_plus import file_selector_macos import flutter_image_compress_macos import flutter_inappwebview_macos +import gal import irondash_engine_context import package_info_plus import path_provider_foundation @@ -25,6 +26,7 @@ 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")) + GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin")) IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ee33d08..4506297 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -17,6 +17,9 @@ dependencies: zds_flutter: path: ../ flutter_quill: ^9.2.2 + flutter_localizations: + sdk: flutter + zeta_flutter: ^0.1.1+1 flutter: uses-material-design: true diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 3c20f2a..d63e604 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -7,15 +7,21 @@ #include "generated_plugin_registrant.h" #include +#include #include +#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); + GalPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("GalPluginCApi")); IrondashEngineContextPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi")); + PermissionHandlerWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); SuperNativeExtensionsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 1e71556..7712a52 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -4,7 +4,9 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows + gal irondash_engine_context + permission_handler_windows super_native_extensions url_launcher_windows ) diff --git a/lib/src/components/molecules/block_table.dart b/lib/src/components/molecules/block_table.dart index d0dc355..b5ae16e 100644 --- a/lib/src/components/molecules/block_table.dart +++ b/lib/src/components/molecules/block_table.dart @@ -231,7 +231,6 @@ class _BlockTable extends State with WidgetsBindingObserver { alignment: Alignment.center, width: _getDayColumnWidth(), height: 28, - // height: 28 * MediaQuery.of(context).textScaleFactor, color: themeData.colorScheme.surface, child: Text( items[index].text, diff --git a/lib/src/components/organisms/quill_editor/quill_toolbar.dart b/lib/src/components/organisms/quill_editor/quill_toolbar.dart index ad220e5..c111b87 100644 --- a/lib/src/components/organisms/quill_editor/quill_toolbar.dart +++ b/lib/src/components/organisms/quill_editor/quill_toolbar.dart @@ -275,7 +275,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 @@ -345,7 +345,7 @@ class ZdsQuillToolbar extends QuillToolbar { // default button tooltips final buttonTooltips = tooltips ?? { - ToolbarButtons.undo: context.loc.undo, // 'Undo'.i18n, + ToolbarButtons.undo: context.loc.undo, ToolbarButtons.redo: context.loc.redo, ToolbarButtons.fontFamily: context.loc.fontFamily, ToolbarButtons.fontSize: context.loc.fontSize, @@ -376,6 +376,7 @@ class ZdsQuillToolbar extends QuillToolbar { ToolbarButtons.link: context.loc.link, ToolbarButtons.search: context.loc.search, }; + return Container( decoration: configurations.decoration ?? BoxDecoration(color: configurations.color), constraints: BoxConstraints.tightFor( @@ -482,7 +483,7 @@ class ZdsQuillToolbar extends QuillToolbar { iconSize: toolbarIconSize, iconTheme: iconTheme, afterButtonPressed: afterButtonPressed, - // tooltip: buttonTooltips[ToolbarButtons.underline], + tooltip: buttonTooltips[ToolbarButtons.underline], ), ), if (showStrikeThrough) @@ -723,52 +724,18 @@ class ZdsQuillToolbar extends QuillToolbar { tooltip: buttonTooltips[ToolbarButtons.search], ), ), - if (showFontFamily) - QuillToolbarFontFamilyButton( + if (customButtons.isNotEmpty) + if (showDividers) QuillToolbarDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), + for (final customButton in customButtons) + QuillToolbarCustomButton( + options: customButton.options, controller: controller, - options: QuillToolbarFontFamilyButtonOptions( - iconTheme: iconTheme, - iconSize: toolbarIconSize, - afterButtonPressed: afterButtonPressed, - // rawItemsMap: fontFamilies,TODO: - ), ), - if (showFontSize) - QuillToolbarFontSizeButton( + for (final customButton in configurations.customButtons) + QuillToolbarCustomButton( + options: customButton, controller: controller, - options: QuillToolbarFontSizeButtonOptions( - iconSize: toolbarIconSize, - afterButtonPressed: afterButtonPressed, - // iconTheme: iconTheme, - // rawItemsMap: fontSizes,TODO: - tooltip: buttonTooltips[ToolbarButtons.fontSize], - ), ), - 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: customButton!.options, - - // // 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 a9234b3..8592b93 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: flutter_localizations: sdk: flutter flutter_quill: ^9.2.2 + flutter_quill_extensions: ^9.2.2 flutter_slidable: ^3.0.0 flutter_svg: ^2.0.7 flutter_swipe_action_cell: ^3.0.2 @@ -69,7 +70,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - lottie: ^2.1.0 + lottie: ^3.0.0 zds_analysis: ^1.0.0 flutter: