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
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
documentOffsetfrom this DocumentLayout's coordinate space to the same location on the screen within theancestor's coordinate space. -
getComponentByNodeId(
String nodeId) → DocumentComponent< StatefulWidget> ? -
Returns the DocumentComponent that renders the DocumentNode with
the given
nodeId, ornullif no such component exists. -
getDesiredCursorAtOffset(
Offset documentOffset) → MouseCursor? -
Returns the MouseCursor that's desired by the component at
documentOffset, ornullif the document has no preference for the MouseCursor at the givendocumentOffset. -
getDocumentOffsetFromAncestorOffset(
Offset ancestorOffset, [RenderObject? ancestor]) → Offset -
Converts
ancestorOffsetfrom theancestor'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, ornullif thelayoutOffsetdoes not exist within a piece of document content. -
getDocumentPositionNearestToOffset(
Offset layoutOffset) → DocumentPosition? -
Returns the DocumentPosition at the y-value of the given
layoutOffsetthat sits closest to the x-value of the givenlayoutOffset, ornullif there is no document content at the given y-value. -
getDocumentSelectionInRegion(
Offset baseOffset, Offset extentOffset) → DocumentSelection? -
Returns a DocumentSelection that begins near
baseOffsetand extends toextentOffset, ornullif 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
documentOffsetfrom 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, ornullif 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
basePositionandextentPosition. -
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