document library

The pure-Dart document model: Delta-compatible documents, attributes, nodes, history, and edit rules. Usable without Flutter (e.g. on a server).

Classes

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.
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.
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.
ChildQuery
Result of ContainerNode.queryChild: the child at a requested offset and the offset translated into that child's local coordinates.
ContainerNode<T extends Node>
A Node that holds an ordered list of child nodes of type T.
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.
DocumentChange
One change applied to a Document: the document state before it, the change delta composed into it, and its source.
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.
FormatEmbedRule
Applies an embed-scope attribute to the embed positions within the range, retaining text positions unchanged.
History
Undo/redo stacks for a Document, implemented with inverted deltas.
HistoryOptions
Tuning knobs for History.
InsertEmbedRule
Places a block embed on its own line, splitting the current line around it when it is inserted mid-line.
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'.
Node
A node in the document tree.
Operation
Operation performed on a rich-text document.
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.
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.
Style
An immutable set of Attributes keyed by attribute key.
TextLeaf
A run of text within a line sharing a single Style.

Enums

AlignStyle
Line alignment, serialized as the value of the align attribute.
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 direction attribute.
ListStyle
The list styles a line can belong to, serialized as the value of the list attribute.
RuleType
The kind of edit intent a rule responds to.
ScriptStyle
Vertical position of an inline run, serialized as the value of the script attribute.

Typedefs

AttributeValueDecoder = Object? Function(Object? raw)
Normalizes a raw JSON attribute value into its canonical Dart type.