Rich text editor for Flutter based on Delta format (Quill fork)

Overview

Visual Editor

Visual Editor is a Rich Text editor for Flutter originally forked from Flutter Quill. The editor is built around the powerful Delta document format originally developed by QuillJs. Delta documents can be easily converted to JSON, the encoding is easy to read and modify and offers many extensibility options.

Our core motivation to fork Quill was the severe lack of documentation and testing plus a lack of support from the maintainers when it comes to receiving technical support. Considering that we plan to release many more open source Flutter widgets, starting with the rich text editor was a no brainer.

Planned Features

  • Improved, easy to digest architecture
  • Full docs
  • Full test coverage
  • Highlights
  • Code Samples
  • Tables
  • Nested bullets
  • Layouts
  • Styled blocks
  • Color coding for source code
  • Themes
  • Search
  • Bug fixes

Visual Coding - Tutorials about Visual Editor and software architecture

FlutterQuill - The Original repo that we forked

How To Start

Minimal example, toolbar and editor with a shared controller:

QuillController _controller = QuillController.basic();
Column(
  children: [
    QuillToolbar.basic(controller: _controller),
    Expanded(
      child: Container(
        child: QuillEditor.basic(
          controller: _controller,
          readOnly: false,
        ),
      ),
    )
  ],
)

Input / Output

This library uses Quill as an internal data format.

  • _controller.document.toDelta() - Extract the deltas.
  • _controller.document.toPlainText() - Extract plain text.

Saving a document as JSON

Saving a document

var json = jsonEncode(_controller.document.toDelta().toJson());

Retrieving a document

const blogPost = jsonDecode(response);

_controller = QuillController(
  document: Document.fromJson(blogPost),
  selection: TextSelection.collapsed(offset: 0)
);

This readme will be expanded with detailed instruction on how to use Visual Editor. Currently we are ongoing a deep cleanup effort.

Comments
  • Highlights - Programmatic add/removal of highlights

    Highlights - Programmatic add/removal of highlights

    This pull enables adding highlights programmatically, and also introduces some helper methods to make managing HighlightM objects easier. Additionally, the ability to programmatically remove arbitrary sections of a highlight (and have the highlights persist) has been added.

    closed 
    opened by kulny 7
  • Sys - Full documentation

    Sys - Full documentation

    This was one of the major pain points when using Flutter Quill. I'm working in parallel with the refactoring work to develop a full set of documentation articles that cover all use cases. Please post here what you think it's missing from the documentation. I'll be happy to receive feedback.

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by adrian-moisa 7
  • Sys - Maintainable Architecture

    Sys - Maintainable Architecture

    It will be a while until visual editor is all packed up and ready to serve duty. At best at least 1 month until we get testing and docs such that we can provide a better service. (I mean it's currently usable as it is a direct clone of Flutter Quill). I've been already going trough the steps to setup the repo. There's a lot to review. Today I started work on the cleanup effort. There's a lot to unpack here. My first goal, not have files with over 300 LOC. And to split in modules. Plus rename / document where necessary to make it easy to follow the code flow.

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by adrian-moisa 7
  • Sys - Editor crashes every time parent setState is called

    Sys - Editor crashes every time parent setState is called

    Every time I call setState() in the parent component which is pretty critical for me. I think it's initialized as late here.

    Component looks like this when I'm calling setState. image

    Code snippet:

    class Screen extends StatefulWidget {
      @override
      State<Screen> createState() => _ScreenState();
    }
    
    class _ScreenState extends State<Screen> {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: Form(
              child: ListView(
                children: [
                  EditorToolbar.basic(
                    controller: controller,
                  ),
                  Expanded(
                    child: VisualEditor.basic(
                      controller: controller,
                    ),
                  ),
                  OutlinedButton(
                      onPressed: () => {
                        setState();
                      },
                      child: const Text('Break')),
                ],
              ),
            ),
        );
      }
    }
    
    

    I only tried it in web.

    Video: https://cdn.discordapp.com/attachments/972503769113829427/996005922193281127/Peek_2022-07-11_12-49.mp4

    1.0 
    opened by Phil9l 6
  • Markers - Custom markers embedded in the document

    Markers - Custom markers embedded in the document

    Markers are highlights that are permanently embedded in the document. Meaning the delta document uses a dedicated attribute for markers. Highlights are defined without touching the delta document and have a short life span. They can be used to highlight portions of the document. Markers can be triggered in several ways, either by hovering them, or by invoking a method. Markers can belong to a set. Multiple marker sets can be defined, each one with unique colors, callbacks and settings.


    Temporary Notes:

    Markers

    V - Markers folder

    • Hide markers (all, set, individual) --> BRAINSTORM
    • New attribute
    • Generic API with
      • Type, id, color, callback,
    • Preserve at copy paste
    • Toolbar Dropdown (Lists marker sets)
    • Testing
    • Docs

    Markers

    • Capture markers so far for YT, Capture highlights
    • Update docs on the markers .md
    • Highlights demo, Select text, add highlight
    • Use setHighlights
    • Highlights tests
    • Highlights controller methods
    • Study V - How TextLine works, V - How Styles are applied to Text spans, V - How embeds are rendered V - How attributes are converted to nodes
      • Why check for only inline or only ignored? How to add custom attributed without changing core? Data resolver?

    Highlights

    • setHighlights()
      • Trigger update
      • Checks doc boundaries
    • resetHighlights()
      • FIx highlights hover

    Study

    • Link text spans have gesture recognizers. We can use them for the marker attribute.
    • lineLeadingWidget - Maybe this is how I can do the heading counters
    • Attributes seem to be a plain old map of keys and values. So anything could be added there.
      • Multiple styles are allowed per attributes
      • Unknown styles are rejected
    • We need to define new attributes to be recognised
    • StyleM converts attributes to models
      • attr = AttributeM.fromKeyValue(key, value);
      • looks for the attribute in the registry
      • So it appears we can only use known attributes
        • It appears to be creating an AttributeM but with AttributeM(key, AttributeScope.IGNORE, value)
    • Can we define new attributed from outside of the lib?
      • So far I can see they end up in the ignore scope and if there's a mix of inline or ignore then the editor fails, but there's no explanation why.
    • Most likely I need to define data decoders for the custom data types (embeds)
    • Useful with embedded blocks. typedef DataDecoder
    • Many attributes seem to have a value although there's no useful info in it. For example bold has value true... ok... and what happens with value false?
    1.0 
    opened by adrian-moisa 6
  • Blocks - Enumeration order messes up after indentation

    Blocks - Enumeration order messes up after indentation

    I noticed a small bug when implementing the Quill Editor. It happens when using the enumeration feature. I was pretty amazed when I found out that the indent button changes the enumeration from numbers to letters on indent, but it seems that once you go back to the first indentation level, the enumeration always resumes at '2'. Additionally, the one after that is a 2 as well. After that it will resort to normal.

    156074595-bafce533-5d55-41b9-acb3-21023bc97241

    I tried it as well for a list of say 9 items and then creating an indent at 9.a. Pressing Enter and the Decrease Indentation button make the item after 9 resort to 2. Writing some text and pressing Enter again yields a 2 again.

    Original issue: https://github.com/singerdmx/flutter-quill/issues/696

    Join us on discord to get implementation advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter software architecture advice.

    duplicate 
    opened by adrian-moisa 5
  • Sys - Translation country code must be lower case

    Sys - Translation country code must be lower case

    Locale class use upper case for country code in dart. But i18n is found to use lower case for identification. The 'zh_CN' and 'zh_HK' needs to change to 'zh_cn' and 'zh_hk' for i18n to select the correct translation.

    Original issue: https://github.com/singerdmx/flutter-quill/issues/868

    parked 
    opened by adrian-moisa 4
  • Editor - Multiple columns layouts

    Editor - Multiple columns layouts

    Even if we don't display content as pages, the ability to select a section of the document and setup a multiple columns layout would be highly beneficial. Besides columns we can introduce in the future custom shapes or other grid types.

    martin-spread

    Join us on discord to get implementation advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter software architecture advice.

    parked 
    opened by adrian-moisa 3
  • Blocks - Code blocks, Inline Code, RobotoMono font

    Blocks - Code blocks, Inline Code, RobotoMono font

    Current source code uses a regular font as it was done in Flutter Quill. Which is not the way code editors handle this situation.

    image

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by adrian-moisa 3
  • Markers - Undo, Redo, removes all markers

    Markers - Undo, Redo, removes all markers

    Hitting undo and redo will remove the markers. We are expecting to have the markers restored as well. All other styles work just fine. Maybe there's something related to the markers attribute format (objects instead of primite value).

    This issue might be fixed if we fix the copy paste losing styles issue: #8

    https://user-images.githubusercontent.com/11160141/193270535-add5b1f0-1e12-4123-99cd-061601253b38.mov

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    duplicate 
    opened by adrian-moisa 2
  • Markers - Marker attachments

    Markers - Marker attachments

    Position widgets in sync with the markers found in the text

    Markers provide support for attachments by returning their pixel coordinates and dimensions for positioning in text. Based on this information any widget can be linked to a marker. Keep in mind that markers are not widgets, so a simple Overlay from Flutter wont do the trick. Markers are rendered as painted rectangles in a canvas on top of the text. Actually it's possible to use Overlay and CompositeTargetFollower to track the scroll, but we want to have precise control over the coordinates (performance reasons). We simulate attached widgets by positioning them to the exact coordinates. Attachments can be used render elements such as the markers options menu or delete button.

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by adrian-moisa 2
  • Highlights - Highlights pulsate when inserting text quickly

    Highlights - Highlights pulsate when inserting text quickly

    In the limited headings length page, the highlight pulsates every time a char is inserted.

    https://user-images.githubusercontent.com/105392078/209430942-5337ed0d-3ca8-4ba6-8782-102a300d01cc.mp4

    2.0 
    opened by sebastian0107 0
  • Upgrade to i18n_extension: ^6.0.0

    Upgrade to i18n_extension: ^6.0.0

    Hi,

    I tried to add the Visual Editor, but it looks that some libraries are quite old, is it possible to upgrade i18n_extension to ^6.0.0?

    Without this I got some incompatibilities with other libraries.

    1.0 
    opened by vd3d 2
  • Controller - Shift + Tab should not remove characters, only tabs

    Controller - Shift + Tab should not remove characters, only tabs

    Inside the method _removeTabCharacter() logic, when pressing shift + tab even though there aren't any tab char added. The logic is going to remove 4 chars before the charet. That's not what we intend. One possible solution to this is to verify if there are 4 whitespaces before the charet. If there are, apply the method logic, else do not.

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by DariusMuscalu 0
  • Documents - Prevent style changes in code blocks and inline code

    Documents - Prevent style changes in code blocks and inline code

    We need to understand the logic of each rule and model in document rules, create docs for them and then add a rule for not being able to edit the text inside code blocks and inline code.

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    1.0 
    opened by DariusMuscalu 0
  • Demos - Indicator for the current page

    Demos - Indicator for the current page

    The current demo page sidebar does not show any indication which page is currently open. It is somewhat annoying. image

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    2.0 
    opened by adrian-moisa 0
  • Demos - Demo page for custom controls

    Demos - Demo page for custom controls

    • There's a setting in the visual editor to take over the controls and render them in a custom way instead of the dual iOS/android style.
    • We need a demo page to demonstrate how such a custom control works.
    • Tutorial: https://ktuusj.medium.com/flutter-custom-selection-toolbar-3acbe7937dd3

    Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

    2.0 
    opened by adrian-moisa 0
Owner
Visual Space
Meet other creators and work together on world changing projects. Join the beta on http://discord.gg/5V2BWUyEvP
Visual Space
Rich text editor for Flutter

A rich text editor for Flutter FlutterQuill is a rich text editor and a Quill component for Flutter. This library is a WYSIWYG editor built for the mo

X Code 1.7k Jan 4, 2023
An Instagram like text editor Flutter widget that helps you to change your text style.

TextEditor An instagram like text editor widget for flutter Show some ❤️ and star the repo to support the project Features Edit TextStyle object font

Mehdi Zarepour 68 Dec 16, 2022
WYSIWYG editor for Flutter with a rich set of supported formatting options. (WIP)

✨ rich_editor WYSIWYG editor for Flutter with a rich set of supported formatting options. Based on https://github.com/dankito/RichTextEditor, but for

Festus Olusegun 116 Dec 27, 2022
DeerNote is a solution for cross-platform rich editor

#DeerNote is a solution for cross-platform rich editor ###DeerNote contains parts as follows: db: mongodb server: nodejs app: flutter launch mongdb se

null 3 Dec 6, 2022
Json editor - A json editor on flutter

Features Support add comment; Support show errors for invalid json text; Pretty

Chan Young 12 Nov 18, 2022
Masked text field - A flutter package for masked text field for formet your text and good UI

Masked Text Field Masked Text Field Features A package for masked text field for

Alok Dubey 7 Sep 4, 2022
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022
A fork/modification of flutter epub view package

epub_view Pure flutter widget for view EPUB documents on all platforms. Based on epub package. Render with flutter widgets (not native view) on any pl

Geeky Geeky 0 Dec 28, 2021
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
Fluttersettingsui - Fork of settingsui. Create native settings for Flutter app in a minutes.

Settings UI for Flutter Installing: In your pubspec.yaml dependencies: flutter_settings_ui: ^1.0.1 import 'package:flutter_settings_ui/flutter_setti

Julian Steenbakker 22 Oct 24, 2022
Soft and gentle rich text editing for Flutter applications.

About Fleather Soft and gentle rich text editing for Flutter applications based on Zefyr. Clean and modern look Fleather's rich text editor is built w

Fleather 25 Dec 24, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
📝 Simple text editor/notepad with cloud sync.

txt Simple text editor/notepad with cloud sync. Build Install dependencies: flutter pub get Build: flutter build apk, flutter build ios etc. ToDo's Ad

Crazy Marvin 35 Jan 1, 2023
A Flutter based code editor

rich_code_editor A simple package that supports creating code editors in Flutter. Flutter version supported: Flutter 1.22.5 Getting Started There are

Sovit 111 Dec 16, 2022
The Flutter app demonstrates displaying data in a weekly format.

Flutter weekly chart The Flutter app demonstrates displaying data in a weekly format. I came across this kind of screen in the app that I have been wo

BenBoonya 27 Jan 2, 2023
A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumber

Intl Phone Number Input A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumb

Ogunye Nathaniel Oluwatobiloba 138 Dec 11, 2022
Flutter Currency Format Converter Library

Save your time on a little logic converting a currency from integer to string or string to integer. if you intrested to contribute to our little proje

Fathan Akram 1 Dec 7, 2021
MoneyTextFormField is one of the flutter widget packages that can be used to input values in the form of currencies, by displaying the output format in realtime.

MoneyTextFormField MoneyTextFormField is one of the flutter widget packages that can be used to input values in the form of currencies, by displaying

Fadhly Permata 11 Jan 1, 2023