LexicalDocument class
Renders the document held by a LexicalEditor.
This is the read-only view. It is useful on its own — a viewer for documents authored on Lexical web — and it is the substrate the editable widget builds on.
Rebuilds are driven by the dirty set of each commit, not by rebuilding the tree from the state. Lexical already knows which nodes changed; that information is exactly what Flutter needs in order not to rebuild everything, and throwing it away produces a demo that is fast enough until the first real document.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LexicalDocument
Constructors
-
LexicalDocument({required LexicalEditor editor, required LexicalTheme theme, Key? key, Map<
String, DecoratorBuilder> decoratorBuilders = const {}, EdgeInsetsGeometry padding = EdgeInsets.zero, bool scrollable = true, ScrollController? scrollController, TextDirection? textDirection, TextScaler? textScaler, LexicalInteraction? interaction, BlockRegistry? registry, LexicalRenderStats? stats}) -
Renders
editor's document withtheme.const
Properties
-
decoratorBuilders
→ Map<
String, DecoratorBuilder> -
Widget builders for decorator node types.
final
- editor → LexicalEditor
-
The editor whose document is rendered.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interaction → LexicalInteraction?
-
Which node types respond to hover and tap, and how.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- padding → EdgeInsetsGeometry
-
Padding around the document.
final
- registry → BlockRegistry?
-
A registry to publish mounted blocks into.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollable → bool
-
Whether to scroll, using a lazily built list that culls off-screen
blocks.
final
- scrollController → ScrollController?
-
Controller for the internal scroll view.
final
- stats → LexicalRenderStats?
-
Test-only rebuild counters.
final
- textDirection → TextDirection?
-
Overrides the ambient text direction.
final
- textScaler → TextScaler?
-
Overrides the ambient text scaler.
final
- theme → LexicalTheme
-
Styling for text, blocks and markers.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LexicalDocument> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited