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]
- **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
- 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)

@ -199,16 +199,16 @@ 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: () {},
),
```
@ -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');
},
),

@ -458,8 +458,23 @@ class _HomePageState extends State<HomePage> {
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) {

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

Loading…
Cancel
Save