editor library
The editor layer: controller, per-instance services, the extension API
surface, theming, the IME/keyboard input helpers, the document render
layer, the interactive QuillKitEditor, and the stateless
QuillKitViewer.
Deliberately not exported: the editor widget's internals (geometry,
IME client, painters, gesture layer) — they are implementation details
of QuillKitEditor; only the widget itself and its two config classes
(EditorBehavior, EditorAppearance) are public. The input helpers,
including TextDiff/textDiff and the remote-value functions, are
public so embedders can drive a controller from their own input
plumbing.
QuillKitStrings is exported here as well as from toolbar.dart: the
editor's own accessibility labels (the text-field name, the checklist
checkboxes) resolve through the ambient QuillKitStringsScope, so an
app that never imports the toolbar can still localize them.
Re-exports document.dart in full: the controller, the viewer and the
render layer expose Document, Delta, Attribute and Style in
their own signatures, so this entrypoint is usable on its own.
Classes
- AlignmentExtension
- Line alignment and base text direction.
- ApplyHeaderIntent
- Formats the selected lines as a header of level (1–6), or back to a normal paragraph when level is 0. Applying the level a line already has toggles it off.
-
Attribute<
T> - A single formatting property identified by key, carrying a value and a rendering scope.
- AttributeKeys
- The canonical attribute keys used by Quill Delta documents.
- AttributeRegistry
- A per-instance lookup table from attribute keys to AttributeSpecs.
- Attributes
- The built-in attribute set, with keys and values wire-compatible with Quill and flutter_quill.
- AttributeSpec
- Describes one attribute kind: its JSON key, its scope, and how raw JSON values are normalized when a document is loaded.
- AutoLinkShortcut
-
Links a URL automatically when the user types a space or newline after
it:
see https://example.comturns the address into a link. - Block
- A group of consecutive Lines that share the same grouping block format: list membership, code block or block quote.
- BlockEmbed
- An embed that occupies an entire line by convention (image, video, formula), with a string payload — matching the built-in embed types of Quill and flutter_quill.
- BlockquoteSpaceShortcut
-
'> 'at a line start → blockquote. - BlockStyleExtension
- Block styles: headers, blockquote and code block.
- BoldCharacterShortcut
-
'**bold**'or'__bold__'→ bold. - BulletLeading
-
The glyph in front of a bullet-list line, varying with the indent level
the way Quill does:
•,◦,▪, then repeating. - BulletListSpaceShortcut
-
'- 'or'* 'at a line start → bullet list. - CaretContext
- The line context around a caret position, resolved for typing shortcuts.
- CatchAllDeleteRule
- Fallback delete rule: removes the requested range as-is, except that a deletion reaching the end of the document is shortened by one position so the final newline — the Quill document invariant — survives.
- CatchAllInsertRule
- Fallback insert rule: retains up to the insertion point and inserts the data as-is, with no special handling.
- CharacterShortcut
-
Base class for autoformats fired by typing the closing delimiter of a
markdown inline span:
'**bold**','_italic_','~~strike~~','`code`'. - CheckboxLeading
-
The checkbox in front of a checklist line (
list: checked/unchecked). - CheckboxStyle
-
Colors of the leading checkbox of checklist items
(
list: checked/unchecked). - ChecklistSpaceShortcut
-
'[] 'at a line start → unchecked checklist item,'[x] '→ checked. - ChildQuery
- Result of ContainerNode.queryChild: the child at a requested offset and the offset translated into that child's local coordinates.
- ClipboardService
-
Clipboard access for the editor, injected per instance via
EditorScope. - CodeBlockSpaceShortcut
-
'``` 'at a line start → code block. - CodeLineNumberLeading
- The line number in the gutter of a code block, shown when the layout is built with line numbers enabled.
- ColorExtension
- Text and background (highlight) colors.
-
ContainerNode<
T extends Node> -
A Node that holds an ordered list of child nodes of type
T. - CursorStyle
- Appearance of the editor's insertion cursor.
- CustomEmbed
- An application-defined embed whose payload is arbitrary JSON.
- Delta
- Delta represents a document or a modification of a document as a sequence of insert, delete and retain operations.
- Document
- A rich text document: the mutable heart of the model layer.
- DocumentBuilder
- Walks a Document's top-level nodes and produces the vertical list of block widgets that renders it — the layout half of the render layer, shared by the stateless viewer and the editor.
- DocumentChange
- One change applied to a Document: the document state before it, the change delta composed into it, and its source.
- DocumentSpanBuilder
- Builds the InlineSpan tree for one document Line — the single place where leaves become spans, shared by the stateless viewer and (in phase 4b) the editor.
- EditorAppearance
-
How a
QuillKitEditoris laid out: padding, size constraints and the empty-document placeholder. - EditorBehavior
-
How a
QuillKitEditorbehaves: focus, scrolling and IME preferences. - EditorExtension
- The single add-on mechanism of the editor: every feature beyond plain text editing — including the built-in formats — is packaged as an extension.
- EditorScope
- The per-instance service and registry hub of one editor.
- EditorShortcutActions
- Binds the editor's intents to a controller.
- EditRule
- A pure transformation from a document state plus an edit intent to the change Delta that should actually be composed into the document.
- Embeddable
- A non-text object embedded in a document, such as an image or video.
- EmbedLeaf
- A single embedded object within a line.
- EmbedRenderContext
- Everything an EmbedRenderer.build implementation needs to render one embed occurrence.
- EmbedRenderer
- Renders embeds of one type ('image', 'video', ...).
- FontExtension
- Typography formats: font family, font size and line height.
- FormatEmbedRule
- Applies an embed-scope attribute to the embed positions within the range, retaining text positions unchanged.
- HeaderSpaceShortcut
-
'# '…'###### 'at a line start → header level 1–6. - History
- Undo/redo stacks for a Document, implemented with inverted deltas.
- HistoryExtension
-
Undo/redo toolbar buttons (the
historytoolbar group). - HistoryOptions
- Tuning knobs for History.
- IndentIntent
- Changes the indentation of the selected lines by delta levels (positive indents, negative outdents).
- InlineCodeCharacterShortcut
-
'`code`'→ inline code. - InlineCodeStyle
- The "chip" look of inline code spans: a monospace text style plus the background painted behind the span.
- InsertEmbedRule
- Places a block embed on its own line, splitting the current line around it when it is inserted mid-line.
- ItalicCharacterShortcut
-
'*italic*'or'_italic_'→ italic. - Leaf
- The smallest unit of document content: a run of identically formatted text (TextLeaf) or a single embedded object (EmbedLeaf).
- Line
-
A single line of rich text: a sequence of Leaf children terminated by
an implicit
'\n'. - LineWidget
- Renders one document Line as rich text.
- LinkExtension
- Hyperlinks: the link toolbar button and URL auto-linking while typing.
- LinkLauncher
-
Opens link URLs on behalf of the editor, injected per instance via
EditorScope. - ListExtension
- Ordered, bullet and check lists plus indentation.
- ListNumbering
- Sequential numbering of the ordered-list lines within one list block, reproducing Quill's nested-list behavior.
- Node
- A node in the document tree.
- NoopLinkLauncher
-
The default LinkLauncher: does nothing and reports
false. - NumberPointLeading
-
The
1./a./i.marker in front of an ordered-list line. - OpenSearchIntent
- Opens the in-document search UI. The action only fires the callback the widget layer provides — the controller has no UI of its own.
- Operation
- Operation performed on a rich-text document.
- OrderedListSpaceShortcut
-
'1. 'at a line start → ordered list. - PreserveInlineStylesRule
- Makes typed text adopt the inline formatting around the caret, the way Quill (and every word processor) behaves: type after bold text and the new text is bold.
- PreserveLineStyleOnMergeRule
- Preserves the first line's style when a deletion starts by removing a newline, merging that line with the one that ends up following it.
- QuillKitController
- The editing brain of a QuillKit editor: a Document plus a TextSelection, with commands that funnel every edit through the document's rules and history.
- QuillKitEditor
- The interactive QuillKit rich text editor.
- QuillKitExtensions
- Ready-made bundles of the built-in EditorExtensions.
- QuillKitStrings
- Every user-facing string of QuillKit — toolbar tooltips and dialogs plus the accessibility labels of the editor surface — with English defaults.
- QuillKitStringsScope
- Provides a QuillKitStrings to descendant toolbar widgets.
- QuillKitTheme
- Provides a QuillKitThemeData to descendant QuillKit widgets.
- QuillKitThemeData
- The visual configuration of a QuillKit editor or viewer.
- QuillKitViewer
- A genuinely stateless, read-only renderer for a Quill Document — pure Delta → UI, with no controller, focus node, IME client or gesture machinery.
- RecognizerBag
- Owns the GestureRecognizers created while building spans, so they can be disposed together when the spans are discarded.
- ResolveInlineFormatRule
- Applies an inline-scope attribute to every character in the range except newlines.
- ResolveLineFormatRule
- Applies a block-scope attribute strictly to newline positions.
- Root
- The root of a document tree: an ordered sequence of Lines and Blocks.
- RuleSet
- An ordered collection of EditRules consulted for every edit.
- SegmentLeaf
- The line and leaf found at a document offset; see Document.querySegmentLeaf.
- SpaceShortcut
-
Base class for autoformats fired by typing a space after a markdown
prefix at the start of a line (
'# ','1. ','> ', ...). - StrikeCharacterShortcut
-
'~~strike~~'→ strikethrough. - Style
- An immutable set of Attributes keyed by attribute key.
- StyleResolver
- The single place where document Styles are mapped to Flutter text styles using a QuillKitThemeData.
- SystemClipboardService
- The default ClipboardService: plain text via Flutter's Clipboard platform API, no rich content.
- TextBlockStyle
- How one kind of text block (paragraph, header, quote, code block, list) is rendered: its base text style, its vertical spacing, and an optional box decoration painted behind the block.
- TextDiff
- The minimal edit turning one string into another: at start, deleted was removed and inserted took its place.
- TextLeaf
- A run of text within a line sharing a single Style.
- TextStyleExtension
- Inline text formats: bold, italic, underline, strikethrough, inline code, sub/superscript and small.
- ToggleStyleIntent
-
Toggles attribute on the current selection (bold, italic, underline,
strike, inline code, lists, quote, ...). Bound by default to the
platform's primary modifier + B/I/U etc.; handled via
QuillKitController.formatSelection. - ToolbarItem
-
One declarative toolbar entry contributed by an
EditorExtension. - ToolbarItemContext
- Everything a ToolbarItem.build implementation needs to render one toolbar entry.
- TypingShortcut
-
A markdown-style autoformat triggered while typing, such as
'# 'at a line start turning the line into a header, or'**bold**'collapsing into bold text. - TypingShortcutEngine
- Runs a controller's TypingShortcuts after each committed insertion.
- UnknownEmbedPlaceholder
- Placeholder rendered for embeds whose type has no matching EmbedRenderer.
- VerticalSpacing
- Vertical spacing applied above and below a laid-out element.
Enums
- AlignStyle
-
Line alignment, serialized as the value of the
alignattribute. - AttributeScope
- Where in a document an attribute may be applied and how it participates in rendering.
- ChangeSource
- Where a document change originated.
- DirectionStyle
-
Base text direction of a line, serialized as the value of the
directionattribute. - ListStyle
-
The list styles a line can belong to, serialized as the value of the
listattribute. - RuleType
- The kind of edit intent a rule responds to.
- ScriptStyle
-
Vertical position of an inline run, serialized as the value of the
scriptattribute.
Functions
-
applyRemoteValue(
QuillKitController controller, TextEditingValue value) → bool -
Applies
value, an incoming IME state, tocontroller: diffs the text, replays the edit through the controller, adopts the new selection, and — when the insertion is a committed one (not mid-composition) — offers it to the controller's typing shortcuts. Returns whether the document changed. -
buildRemoteValue(
QuillKitController controller) → TextEditingValue - The TextEditingValue the editor should push to the platform for the controller's current document and selection.
-
checklistAttribute(
{required bool checked}) → Attribute< String?> -
The attribute change a checkbox toggle maps to:
list: checkedwhencheckedis true,list: uncheckedotherwise. -
defaultEditorShortcuts(
{TargetPlatform? platform}) → Map< ShortcutActivator, Intent> - The default platform-aware keyboard map of the editor.
-
effectiveLineStyle(
Line line) → Style -
The effective style of
line: its own line attributes merged with the grouping attributes carried by its parent Block (list, code-block, blockquote), which is whatStyleResolver.resolveBlockexpects. -
encodeQuillColor(
Color color) → String -
Encodes
coloras a Quill color string: lowercase'#rrggbb'when fully opaque,'#aarrggbb'otherwise (the inverse of parseQuillColor). -
formatListNumber(
int number, int indentLevel) → String -
Formats an ordered-list ordinal the way Quill does, cycling the numeral
system with the indent level: decimal (
1), lowercase letters (a), lowercase roman (i), then decimal again. -
lineAt(
Document document, int lineIndex) → Line? -
The
lineIndex-th line ofdocument(0-based, counting every line in document order across blocks), ornullwhen out of range. -
parseQuillColor(
String? source) → Color? -
Parses a Quill color string (
'#RRGGBB'or'#AARRGGBB', case insensitive,#optional) into a Color. -
textDiff(
String oldText, String newText, int cursorPosition) → TextDiff -
Computes the edit that turned
oldTextintonewText, usingcursorPosition— the caret position innewTextafter the edit — to resolve ambiguity (in a run of identical characters the change is anchored so it ends at the caret, matching what the user actually typed). -
toggleChecklistLine(
Document document, int lineIndex, {required bool checked}) → Delta -
Applies a checkbox toggle to
document: reformats thelineIndex-th line aslist: checked/uncheckedpercheckedand returns the change actually applied (empty when the line does not exist).
Typedefs
- AttributeValueDecoder = Object? Function(Object? raw)
- Normalizes a raw JSON attribute value into its canonical Dart type.
- CheckboxTapCallback = void Function(int lineIndex, bool checked)
-
Signature of the viewer's/editor's checkbox tap callbacks: the 0-based
index of the tapped line (see
lineAt) and the checkbox's new state.