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

outdated

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:quill_html_editor/quill_html_editor.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  ///  create a key to access the the editor methods
  final GlobalKey<QuillHtmlEditorState> htmlKey =
      GlobalKey<QuillHtmlEditorState>();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Quill Html Editor'),
        ),
        body: QuillHtmlEditor(
          editorKey: htmlKey,
          height: 400,
          isEnabled: true, // to disable the editor set it to false (default value is true)
        ),
      ),
    );
  }

  /// to get the html text from editor
  void getHtmlText() async {
    String? htmlText = await htmlKey.currentState?.getText();
    debugPrint(htmlText.toString());
  }

  /// to set the html text to editor
  void setHtmlText(String text) async {
    await htmlKey.currentState?.setText(text);
  }

  /// to clear the editor
  void clearEditor() => htmlKey.currentState?.clear();

  /// to enable the editor
  void enableEditor() => htmlKey.currentState?.enableEditor();
}
246
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

flutter, flutter_web_plugins, webviewx

More

Packages that depend on quill_html_editor