DocumentSpanBuilder class

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.

Text leaves resolve their inline attributes through StyleResolver.resolveInline on top of the line's block base style; embed leaves become WidgetSpans produced by the matching EmbedRenderer (looked up by embed type), falling back to UnknownEmbedPlaceholder when no renderer matches.

Link handling is optional and injected: when onTapLink is non-null, linked runs get a TapGestureRecognizer (registered in the caller's RecognizerBag — see its docs for the lifecycle contract) and a click mouse cursor; when it is null, no recognizer is created at all and links are styled but inert.

Annotations

Constructors

DocumentSpanBuilder({required StyleResolver resolver, List<EmbedRenderer> embedRenderers = const <EmbedRenderer>[], ValueChanged<String>? onTapLink, bool readOnly = true, QuillKitController? controller})
Creates a span builder.
const

Properties

controller → QuillKitController?
Forwarded to EmbedRenderContext.controller; null in the viewer.
final
embedRenderers → List<EmbedRenderer>
The renderers embeds are matched against, by EmbedRenderer.type. When several renderers share a type, the first match wins.
final
hashCode → int
The hash code for this object.
no setterinherited
Called with the link URL when a linked run is tapped; null disables tap handling (no recognizers are created).
final
readOnly → bool
Forwarded to EmbedRenderContext.readOnly.
final
resolver → StyleResolver
Maps document styles to Flutter text styles.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildLine(BuildContext context, Line line, {required TextStyle baseStyle, required RecognizerBag recognizers}) → InlineSpan
Builds the span tree for line on top of baseStyle (the resolved block text style of the line).
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