In version 11.0.0 and later, the QuillToolbar widget has been removed. It was previously used as a non-visual provider for localization and toolbar settings.
For QuillSimpleToolbar, no action is required as it handles these internally.
For custom toolbars, you must now:
- Add the required localization delegate in your app widget.
- Remove the
QuillToolbar wrapper. - Configure buttons individually using their specific constructors instead of using
QuillToolbarConfigurations.
To customize buttons from the flutter_quill library within your custom toolbar, pass QuillToolbarBaseButtonOptions to each button's baseOptions parameter.
final QuillController _controller = QuillController.basic();
final QuillToolbarBaseButtonOptions _baseOptions = QuillToolbarBaseButtonOptions(
afterButtonPressed: () {
// Do something
}
);
YourCustomToolbar(
buttons: [
QuillToolbarToggleStyleButton(
controller: _controller,
baseOptions: _baseOptions,
attribute: Attribute.bold,
),
QuillToolbarClearFormatButton(
controller: _controller,
baseOptions: _baseOptions,
),
QuillToolbarFontSizeButton(
controller: _controller,
baseOptions: _baseOptions,
options: const QuillToolbarFontSizeButtonOptions(
items: {'Small': '8', 'Medium': '24.5', 'Large': '46'},
),
)
],
);