Update README.md

pull/1517/head
Ellet 1 year ago
parent b61c4353ce
commit c4469b9df6
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 2
      CHANGELOG.md
  2. 32
      README.md
  3. 19
      example/lib/pages/home_page.dart
  4. 1
      lib/src/models/config/toolbar/buttons/custom_button.dart

@ -1,6 +1,8 @@
## [8.4.0] ## [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**: 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<QuillToolbarCustomButtonOptions>`
- Bug fixes with the new `8.0.0` update - Bug fixes with the new `8.0.0` update
- Update `README.md`
## [8.3.0] ## [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) - 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)

@ -199,16 +199,16 @@ To use your own fonts, update your [assets folder](https://github.com/singerdmx/
### Custom Buttons ### 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 ```dart
QuillCustomButton( QuillToolbarCustomButtonOptions(
iconData: Icons.ac_unit, icon: const Icon(Icons.ac_unit),
onTap: () { tooltip: '',
debugPrint('snowflake'); onPressed: () {},
} afterButtonPressed: () {},
), ),
``` ```
@ -218,21 +218,21 @@ Each `QuillCustomButton` is used as part of the `customButtons` option as follow
QuillToolbar( QuillToolbar(
configurations: QuillToolbarConfigurations( configurations: QuillToolbarConfigurations(
customButtons: [ customButtons: [
QuillCustomButton( QuillToolbarCustomButtonOptions(
iconData: Icons.ac_unit, icon: const Icon(Icons.ac_unit),
onTap: () { onPressed: () {
debugPrint('snowflake1'); debugPrint('snowflake1');
}, },
), ),
QuillCustomButton( QuillToolbarCustomButtonOptions(
iconData: Icons.ac_unit, icon: const Icon(Icons.ac_unit),
onTap: () { onPressed: () {
debugPrint('snowflake2'); debugPrint('snowflake2');
}, },
), ),
QuillCustomButton( QuillToolbarCustomButtonOptions(
iconData: Icons.ac_unit, icon: const Icon(Icons.ac_unit),
onTap: () { onPressed: () {
debugPrint('snowflake3'); debugPrint('snowflake3');
}, },
), ),

@ -458,8 +458,23 @@ class _HomePageState extends State<HomePage> {
QuillToolbar get quillToolbar { QuillToolbar get quillToolbar {
final customButtons = [ final customButtons = [
const QuillToolbarCustomButtonOptions( QuillToolbarCustomButtonOptions(
icon: Icon(Icons.add), 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) { if (kIsWeb) {

@ -17,7 +17,6 @@ class QuillToolbarCustomButtonOptions extends QuillToolbarBaseButtonOptions<
this.icon, this.icon,
this.iconButtonFactor, this.iconButtonFactor,
this.iconSize, this.iconSize,
super.iconData,
super.afterButtonPressed, super.afterButtonPressed,
super.tooltip, super.tooltip,
super.iconTheme, super.iconTheme,

Loading…
Cancel
Save