WordBoundary class

A TextBoundary subclass for locating word breaks.

The underlying implementation uses UAX #29 defined default word boundaries.

The default word break rules can be tailored to meet the requirements of different use cases. For instance, the default rule set keeps horizontal whitespaces together as a single word, which may not make sense in a word-counting context -- "hello world" counts as 3 words instead of 2. An example is the moveByWordBoundary variant, which is a tailored word-break locator that more closely matches the default behavior of most platforms and editors when it comes to handling text editing keyboard shortcuts that move or delete word by word.



hashCode int
The hash code for this object.
no setterinherited
moveByWordBoundary TextBoundary
Returns a TextBoundary suitable for handling keyboard navigation commands that change the current selection word by word.
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


getLeadingTextBoundaryAt(int position) int?
Returns the offset of the closest text boundary before or at the given position, or null if no boundaries can be found.
getTextBoundaryAt(int position) TextRange
Returns the text boundary range that encloses the input position.
getTrailingTextBoundaryAt(int position) int?
Returns the offset of the closest text boundary after the given position, or null if there is no boundary can be found after position.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


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