DocumentComponent<T extends StatefulWidget> mixin

Contract for all widgets that operate as document components within a DocumentLayout.

DocumentComponent is defined as a mixin on a State<T> because document layouts may require access to a DocumentComponent's RenderBox.

Superclass constraints
Mixin applications

Properties

context BuildContext
The location in the tree where this widget builds.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
mounted bool
Whether this State object is currently in a tree.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widget → T
The current configuration.
no setterinherited

Methods

activate() → void
Called when this object is reinserted into the tree after having been removed via deactivate.
inherited
build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
deactivate() → void
Called when this object is removed from the tree.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
didChangeDependencies() → void
Called when a dependency of this State object changes.
inherited
didUpdateWidget(covariant T oldWidget) → void
Called whenever the widget configuration changes.
inherited
dispose() → void
Called when this object is removed from the tree permanently.
inherited
getBeginningPosition() NodePosition
Returns the node position that represents the "beginning" of the content within this component, such as the first character of a paragraph.
getBeginningPositionNearX(double x) NodePosition
Returns the earliest position within this component's DocumentNode that appears at or near the given x position.
getCollapsedSelectionAt(NodePosition nodePosition) NodeSelection
Returns a NodeSelection within this component's DocumentNode that is collapsed at the given nodePosition
getDesiredCursorAtOffset(Offset localOffset) MouseCursor?
Returns the desired MouseCursor at the given (x,y) localOffset, or null if this component has no preference for the cursor style.
getEdgeForPosition(NodePosition nodePosition) Rect
Returns the upstream edge or downstream edge of the content at the given position.
getEndPosition() NodePosition
Returns the [NodePosition that represents the "end" of the content within this component, such as the last character of a paragraph.
getEndPositionNearX(double x) NodePosition
Returns the latest position within this component's DocumentNode that appears at or near the given x position.
getOffsetForPosition(NodePosition nodePosition) Offset
Returns the (x,y) Offset for the given nodePosition, or throws an exception if the given nodePosition is not compatible with this component's node type.
getPositionAtOffset(Offset localOffset) NodePosition?
Returns the node position within this component at the given localOffset, or null if the localOffset does not sit within any content.
getRectForPosition(NodePosition nodePosition) Rect
Returns a Rect for the given nodePosition, or throws an exception if the given nodePosition is not compatible with this component's node type.
getRectForSelection(NodePosition baseNodePosition, NodePosition extentNodePosition) Rect
Returns a Rect that bounds the content selected between baseNodePosition and extentNodePosition.
getSelectionBetween({required NodePosition basePosition, required NodePosition extentPosition}) NodeSelection
Returns a NodeSelection within this component's DocumentNode that spans from basePosition to extentPosition.
getSelectionInRange(Offset localBaseOffset, Offset localExtentOffset) NodeSelection?
Returns a selection of content that appears between the localBaseOffset and the localExtentOffset, or null if the given region does not include any of the content within this component.
getSelectionOfEverything() NodeSelection
Returns a [NodeSelection that includes all content within the node.
initState() → void
Called when this object is inserted into the tree.
inherited
isVisualSelectionSupported() bool
Returns true if this component changes its visual appearance when selected, or false otherwise.
movePositionDown(NodePosition currentPosition) NodePosition?
Returns a new position within this component's node that corresponds to the currentPosition moved down one unit, as interpreted by this component/node.
movePositionLeft(NodePosition currentPosition, [MovementModifier? movementModifier]) NodePosition?
Returns a new position within this component's node that corresponds to the currentPosition moved left one unit, as interpreted by this component/node, in conjunction with any relevant movementModifier.
movePositionRight(NodePosition currentPosition, [MovementModifier? movementModifier]) NodePosition?
Returns a new position within this component's node that corresponds to the currentPosition moved right one unit, as interpreted by this component/node, in conjunction with any relevant movementModifier.
movePositionUp(NodePosition currentPosition) NodePosition?
Returns a new position within this component's node that corresponds to the currentPosition moved up one unit, as interpreted by this component/node.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reassemble() → void
Called whenever the application is reassembled during debugging, for example during hot reload.
inherited
setState(VoidCallback fn) → void
Notify the framework that the internal state of this object has changed.
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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