Skip to content

Latest commit

 

History

History
48 lines (41 loc) · 1.08 KB

custom_buttons.md

File metadata and controls

48 lines (41 loc) · 1.08 KB

🔘 Custom QuillSimpleToolbar Buttons

You may add custom buttons to the end of the toolbar, via the customButtons option, which is a List of QuillToolbarCustomButtonOptions.

Adding an Icon 🖌️

To add an Icon:

    QuillToolbarCustomButtonOptions(
        icon: const Icon(Icons.ac_unit),
        tooltip: 'Tooltip',
        onPressed: () {},
      ),

Example Usage 📚

Each QuillCustomButton is used as part of the customButtons option as follows:

QuillSimpleToolbar(
  controller: _controller,
  config: QuillSimpleToolbarConfig(
    customButtons: [
      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');
        },
      ),
    ],
  ),
),