quill_html_editor 2.0.2 copy "quill_html_editor: ^2.0.2" to clipboard
quill_html_editor: ^2.0.2 copied to clipboard

HTML rich text editor for Android, iOS and Web, using the QuilJS library.

Quill Html Editor #

HTML rich text editor for Android, iOS, and Web, using the QuillJS library. QuillJS is a free, open source WYSIWYG editor built for the modern web.


📸 Screenshots #

1

1


Usage #

Define a QuillEditorController to access the editor methods, pass the controller to QuillHtmlEditor Widget

  final QuillEditorController controller = QuillEditorController();
QuillHtmlEditor(
    hintText: 'Hint text goes here',
    controller: controller,
    height: MediaQuery.of(context).size.height,
    onTextChanged: (text) => debugPrint('widget text changed $text'),
    isEnabled: true, // to disable the editor set isEnabled to false (default value is true)
)

onTextChanged can be used to listen to the text changes, as defined below

controller.onTextChanged((text) {
  debugPrint('listening to $text');
});

Define ToolBar widget and pass the same controller created for QuillHtmlEditor

 ToolBar(
    padding: const EdgeInsets.all(6),
    controller: controller,
    customButtons: [
        InkWell(onTap: () {}, child: const Icon(Icons.favorite)),
        InkWell(onTap: () {}, child: const Icon(Icons.add_circle)),
    ],
)

Note: toolBarConfig, if not passed to ToolBar, it will show all the Toolbar Buttons. To show only required buttons, please specify the types in the list as show below.

    final customToolBarList = [
      ToolBarStyle.bold,
      ToolBarStyle.italic,
      ToolBarStyle.align,
      ToolBarStyle.color,
    ];

    ToolBar(
        controller: controller,
        toolBarConfig: customToolBarList
    ),

We can also add custom buttons to our ToolBar as shown below

    final customButtons =  [
      InkWell(onTap: () {}, child: const Icon(Icons.favorite)),
      InkWell(onTap: () {}, child: const Icon(Icons.add_circle)),
    ];
    
    ToolBar(
        controller: controller,
        customButtons:customButtons ,
    ),

To get the html string from editor

String? htmlText = await controller.getText();

To set the html string to editor

 await controller.setText(text);

To clear the editor

 controller.clear();

To enable editor

  controller.enableEditor(true);

To disable editor

  controller.enableEditor(false);

Todo #

  • Custom Font Sizes
  • Custom Font Styles
  • Image button should support custom async upload over network and embed url
  • Embed YouTube or video urls
  • Replace selected Text
  • Support for Windows and Mac

Credits #

adrianflutur for webviewx package
Mahad61 for webviewx_plus package
miguelpruivo for filepicker pacakge
marcelogil for eltooltip package, which we used in this package to create custom color picker


MIT License #

Copyright (c) 2022 Pavan Kumar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

210
likes
0
pub points
97%
popularity

Publisher

unverified uploader

HTML rich text editor for Android, iOS and Web, using the QuilJS library.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

file_picker, flutter, flutter_web_plugins, universal_io, webviewx_plus

More

Packages that depend on quill_html_editor