diff --git a/lib/src/models/themes/quill_custom_button.dart b/lib/src/models/themes/quill_custom_button.dart index 111ab13e..eaac9d7b 100644 --- a/lib/src/models/themes/quill_custom_button.dart +++ b/lib/src/models/themes/quill_custom_button.dart @@ -2,6 +2,7 @@ // import '../../widgets/toolbar/base_toolbar.dart'; +<<<<<<< HEAD // class QuillCustomButton extends QuillToolbarBaseButtonOptions { // const QuillCustomButton({ // this.icon, @@ -20,3 +21,23 @@ // /// The customButton placeholder // final Widget? child; // } +======= +class QuillCustomButton extends QuillToolbarBaseButtonOptions { + const QuillCustomButton({ + this.icon, + this.onTap, + super.tooltip, + this.child, + super.iconTheme, + }); + + /// The icon widget + final Widget? icon; + + /// The function when the icon is tapped + final VoidCallback? onTap; + + /// The customButton placeholder + final Widget? child; +} +>>>>>>> ad642da (Update QuillCustomButton) diff --git a/lib/src/widgets/toolbar/buttons/custom_button.dart b/lib/src/widgets/toolbar/buttons/custom_button.dart index 0d736a10..c3e81077 100644 --- a/lib/src/widgets/toolbar/buttons/custom_button.dart +++ b/lib/src/widgets/toolbar/buttons/custom_button.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../../../models/config/toolbar/buttons/custom_button.dart'; import '../../../models/themes/quill_icon_theme.dart'; import '../../../utils/extensions/build_context.dart'; import '../../controller.dart'; diff --git a/lib/src/widgets/toolbar/toolbar.dart b/lib/src/widgets/toolbar/toolbar.dart index 1361e550..6415969d 100644 --- a/lib/src/widgets/toolbar/toolbar.dart +++ b/lib/src/widgets/toolbar/toolbar.dart @@ -411,6 +411,7 @@ class QuillToolbar extends StatelessWidget { space: configurations.sectionDividerSpace, ), for (final customButton in configurations.customButtons) +<<<<<<< HEAD QuillToolbarCustomButton( options: customButton, controller: customButton.controller ?? globalController, @@ -429,6 +430,22 @@ class QuillToolbar extends StatelessWidget { // globalController, // ), // ], +======= + if (customButton.child != null) ...[ + InkWell( + onTap: customButton.onTap, + child: customButton.child, + ), + ] else ...[ + QuillToolbarCustomButton( + options: + toolbarConfigurations.buttonOptions.customButtons, + controller: toolbarConfigurations + .buttonOptions.customButtons.controller ?? + globalController, + ), + ], +>>>>>>> ad642da (Update QuillCustomButton) spacerWidget, ], ];