Sometimes you want to add some custom content inside your text, custom widgets inside them. An example is adding notes to the text, or anything custom that you want to add in your text editor.
The only thing that you need is to add a CustomBlockEmbed and provide a builder for it to the embedBuilders parameter, to transform the data inside the Custom Block into a widget!
Here is an example:
Starting with the CustomBlockEmbed, here we extend it and add the methods that are useful for the 'Note' widget, which will be the Document, used by the flutter_quill to render the rich text.
After that, we need to map this "notes" type into a widget. In that case, I used a ListTile with a text to show the plain text resume of the note, and the onTap function to edit the note. Don't forget to add this method to the QuillEditor after that!
And finally, we write the function to add/edit this note. The showDialog function shows the QuillEditor to edit the note after the user ends the edition, we check if the document has something, and if it has, we add or edit the NotesBlockEmbed inside of a BlockEmbed.custom (this is a little detail that will not work if you don't pass the CustomBlockEmbed inside of a BlockEmbed.custom).