From c4469b9df6e3ad0da084ce782411bfa1443461ea Mon Sep 17 00:00:00 2001 From: Ellet <73608287+freshtechtips@users.noreply.github.com> Date: Thu, 9 Nov 2023 20:47:03 +0300 Subject: [PATCH] Update README.md --- CHANGELOG.md | 2 ++ README.md | 34 +++++++++---------- example/lib/pages/home_page.dart | 19 +++++++++-- .../config/toolbar/buttons/custom_button.dart | 1 - 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9212a62b..2c73ec2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [8.4.0] - **Breaking change**: Update the `QuillCustomButton` to have `QuillCustomButtonOptions`. We moved everything that is in the `QuillCustomButton` to `QuillCustomButtonOptions` but replaced the `iconData` with `icon` widget for more customizations +- **Breaking change**: the `customButtons` in the `QuillToolbarConfigurations` is now of type `List` - Bug fixes with the new `8.0.0` update +- Update `README.md` ## [8.3.0] - Added a `iconButtonFactor` property to `QuillToolbarBaseButtonOptions` to customise how big the button is compared to its icon size (defaults to `kIconButtonFactor` which is the same as previous releases) diff --git a/README.md b/README.md index 7d2892e2..9bc98324 100644 --- a/README.md +++ b/README.md @@ -199,17 +199,17 @@ To use your own fonts, update your [assets folder](https://github.com/singerdmx/ ### Custom Buttons -You may add custom buttons to the _end_ of the toolbar, via the `customButtons` option, which is a `List` of `QuillCustomButton`. +You may add custom buttons to the _end_ of the toolbar, via the `customButtons` option, which is a `List` of `QuillToolbarCustomButtonOptions`. -To add an Icon, we should use a new QuillCustomButton class +To add an Icon, we should use a new `QuillToolbarCustomButtonOptions` class ```dart - QuillCustomButton( - iconData: Icons.ac_unit, - onTap: () { - debugPrint('snowflake'); - } - ), + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + tooltip: '', + onPressed: () {}, + afterButtonPressed: () {}, + ), ``` Each `QuillCustomButton` is used as part of the `customButtons` option as follows: @@ -218,21 +218,21 @@ Each `QuillCustomButton` is used as part of the `customButtons` option as follow QuillToolbar( configurations: QuillToolbarConfigurations( customButtons: [ - QuillCustomButton( - iconData: Icons.ac_unit, - onTap: () { + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { debugPrint('snowflake1'); }, ), - QuillCustomButton( - iconData: Icons.ac_unit, - onTap: () { + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { debugPrint('snowflake2'); }, ), - QuillCustomButton( - iconData: Icons.ac_unit, - onTap: () { + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { debugPrint('snowflake3'); }, ), diff --git a/example/lib/pages/home_page.dart b/example/lib/pages/home_page.dart index 015be85b..538e8f40 100644 --- a/example/lib/pages/home_page.dart +++ b/example/lib/pages/home_page.dart @@ -458,8 +458,23 @@ class _HomePageState extends State { QuillToolbar get quillToolbar { final customButtons = [ - const QuillToolbarCustomButtonOptions( - icon: Icon(Icons.add), + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { + debugPrint('snowflake1'); + }, + ), + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { + debugPrint('snowflake2'); + }, + ), + QuillToolbarCustomButtonOptions( + icon: const Icon(Icons.ac_unit), + onPressed: () { + debugPrint('snowflake3'); + }, ), ]; if (kIsWeb) { diff --git a/lib/src/models/config/toolbar/buttons/custom_button.dart b/lib/src/models/config/toolbar/buttons/custom_button.dart index 92c5180d..9a862e83 100644 --- a/lib/src/models/config/toolbar/buttons/custom_button.dart +++ b/lib/src/models/config/toolbar/buttons/custom_button.dart @@ -17,7 +17,6 @@ class QuillToolbarCustomButtonOptions extends QuillToolbarBaseButtonOptions< this.icon, this.iconButtonFactor, this.iconSize, - super.iconData, super.afterButtonPressed, super.tooltip, super.iconTheme,