DocumentLayout class abstract

Abstract representation of a document layout.

Regardless of how a document is displayed, a DocumentLayout needs to answer various questions about where content sits within the layout. A DocumentLayout is the source of truth for the mapping between logical DocumentPositions and visual (x,y) positions. For example, this mapping allows the app to determine which portion of a String should be selected when the user drags from one (x,y) position to another (x,y) position on the screen.

Implementers

Constructors

DocumentLayout()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

findLastSelectablePosition() DocumentPosition?
Returns the DocumentPosition at the end of the last selectable component.
getAncestorOffsetFromDocumentOffset(Offset documentOffset, [RenderObject? ancestor]) Offset
Converts documentOffset from this DocumentLayout's coordinate space to the same location on the screen within the ancestor's coordinate space.
getComponentByNodeId(String nodeId) DocumentComponent<StatefulWidget>?
Returns the DocumentComponent that renders the DocumentNode with the given nodeId, or null if no such component exists.
getDesiredCursorAtOffset(Offset documentOffset) MouseCursor?
Returns the MouseCursor that's desired by the component at documentOffset, or null if the document has no preference for the MouseCursor at the given documentOffset.
getDocumentOffsetFromAncestorOffset(Offset ancestorOffset, [RenderObject? ancestor]) Offset
Converts ancestorOffset from the ancestor's coordinate space to the same location on the screen within this DocumentLayout's coordinate space.
getDocumentPositionAtOffset(Offset layoutOffset) DocumentPosition?
Returns the DocumentPosition that corresponds to the given layoutOffset, or null if the layoutOffset does not exist within a piece of document content.
getDocumentPositionNearestToOffset(Offset layoutOffset) DocumentPosition?
Returns the DocumentPosition at the y-value of the given layoutOffset that sits closest to the x-value of the given layoutOffset, or null if there is no document content at the given y-value.
getDocumentSelectionInRegion(Offset baseOffset, Offset extentOffset) DocumentSelection?
Returns a DocumentSelection that begins near baseOffset and extends to extentOffset, or null if no document content sits between the provided points.
getEdgeForPosition(DocumentPosition position) Rect?
Returns the upstream edge or downstream edge of the content at the given position.
getGlobalOffsetFromDocumentOffset(Offset documentOffset) Offset
Converts documentOffset from this DocumentLayout's coordinate space to the same location on the screen in the global coordinate space.
getRectForPosition(DocumentPosition position) Rect?
Returns the bounding box around the given position, within the associated component, or null if no corresponding component can be found, or the corresponding component has not yet been laid out.
getRectForSelection(DocumentPosition basePosition, DocumentPosition extentPosition) Rect?
Returns a Rect that bounds the content selected between basePosition and extentPosition.
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