SelectionParagraph class

Render paragraph data.

Implemented types

Constructors

SelectionParagraph({required RenderParagraph? rp, required Rect rect, required String text, required TextSelection trimmedSel, required int paragraphIndex, required int firstCharIndex})
const

Properties

firstCharIndex → int
final
hashCode → int
The hash code for this object.
no setterinherited
isRtl → bool
Returns true if the text direction is right-to-left.
no setter
paragraphIndex → int
final
rect → Rect
final
rp → RenderParagraph?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → String
final
trimmedSel → TextSelection
final

Methods

anchorAtCharIndex(int i, {bool trim = true}) → SelectionAnchor?
Returns a new SelectionAnchor at the provided character index.
anchorAtPt(Offset pt, {bool onlyIfInRect = true, bool trim = true}) → SelectionAnchor?
Returns a new SelectionAnchor at the provided Offset.
anchorAtRange(TextRange? range, {bool trim = true}) → SelectionAnchor?
Returns a new SelectionAnchor with the provided text range.
compareTo(SelectionParagraph? other) → int
Accepts nullable other intentionally. Returns positive when other is null.
override
copyWith({RenderParagraph? rp, Rect? rect, String? text, TextSelection? trimmedSel, int? paragraphIndex, int? firstCharIndex}) → SelectionParagraph
Returns a copy of this paragraph with zero or more property values updated.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rectsForSelection(TextSelection selection) → List<Rect>
Returns the list of Rects for the selection.
toString() → String
A string representation of this object.
inherited
visitChildSpans(InlineSpanVisitorWithIndex visitor) → bool
Walks this paragraph's InlineSpan and its descendants in pre-order and calls visitor for each span that has text.
wordBoundaryAtPt(Offset pt, {bool onlyIfInRect = true}) → TextRange?
Returns the TextRange for the text at the provided Offset.

Operators

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

Static Methods

from(RenderParagraph rp, {required RenderObject ancestor, int paragraphIndex = 0, int firstCharIndex = 0}) → SelectionParagraph?
Returns a new SelectionParagraph or null if the provided RenderParagraph has no size (i.e. has not undergone layout), or if its text is empty or just whitespace.