RichDocument class

A parsed rich-text document — the client's read of the ProseMirror tree TipTap/Filament's RichContentRenderer publishes as <path>.__rich.doc, alongside the flattened <path>.__rich.text a card reads instead (design spec, "Wire shape"). The sibling is absent entirely when there is nothing to convert — absence means unavailable, and every consumer falls back to the raw string; that fallback happens above this parser, which only ever sees a sibling that exists.

The vocabulary is small and closed (design spec, "measured, closed, complete"): ten node types, six marks. This parser does not enforce that closure — an unrecognised node or mark is carried through with its raw type string rather than dropped, so a future Filament version adding one degrades to a paragraph of its descendant text (Task 6) instead of deleting content silently.

Constructors

RichDocument({required RichNode root, required String text})
const
RichDocument.fromJson(Map<String, dynamic> json, String path)
json is the <path>.__rich sibling itself — {"doc": …, "text": …} — not the bare ProseMirror tree.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
root → RichNode
The document tree, rooted at a doc node.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stringify → bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
text → String
The flattened plain text a card reads instead of walking root — carried here too so a consumer holding a RichDocument does not need the sibling's raw JSON a second time.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited