Pure canonical text operations shared by every shape editor adapter.
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
-
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
Static Methods
-
deleteAdjacent(
{required TextStory story, required int offset, required bool backward, DiagramTextDefinition text = const PlainTextDefinition()}) → DiagramTextEditResult - Deletes one complete grapheme, preserving surrounding run formatting. A stale caret inside a cluster removes that entire cluster in either direction rather than leaving a partial combining or emoji sequence.
-
deleteBackwardAtBlockStart(
{required TextStory story, required int blockIndex, DiagramTextDefinition text = const PlainTextDefinition()}) → DiagramTextEditResult - Handles Backspace at the start of a canonical block.
-
deleteForwardAtBlockEnd(
{required TextStory story, required int blockIndex}) → DiagramTextEditResult - Handles Delete at the end of a canonical block by merging its compatible successor. Region boundaries are never crossed.
-
deleteRange(
{required TextStory story, required int start, required int end, DiagramTextDefinition text = const PlainTextDefinition()}) → DiagramTextEditResult - Deletes a story-wide range without flattening independent text regions.
-
formatParagraphsInRange(
{required TextStory story, required int start, required int? end, required TextParagraph format(TextParagraph, TextParagraph?)}) → TextStory - Transforms selected paragraphs in order. Each paragraph observes the already transformed predecessor. Text, identity and region remain stable.
-
formatRuns(
{required TextStory story, required TextRun format(TextRun)}) → TextStory - Transforms every paragraph run without changing text or canonical identity. Empty paragraphs receive one empty run when the transformation adds style.
-
formatRunsInRange(
{required TextStory story, required int start, required int end, required TextRun format(TextRun)}) → TextStory - Changes inline presentation without changing selected text or offsets.
-
insertParagraph(
{required TextStory story, required int start, required int end, DiagramTextDefinition text = const PlainTextDefinition(), bool typed = true}) → DiagramTextEditResult -
Enter (
typed) or a pasted newline replaces a selected range and splits the resulting paragraph in one canonical operation, preserving declared region boundaries.textdecides the split paragraphs' metadata. -
nextBlockId(
TextStory story) → String - Block identity is allocated against authored content, not an edit session.
-
replaceText(
{required TextStory story, required int blockIndex, required int start, required int end, required String text, ({TextRunAttributes? value})? attributes, TextRun? typingStyle}) → TextStory -
Replaces a block-local text range without flattening unaffected rich-text
runs. The inserted text takes the explicitly supplied run
attributes(a null value clears them), or else those oftypingStyleor of the run immediately before/after the caret. Range endpoints may be supplied in either direction and are clamped to the block after normalization. -
selectedBlockIndices(
TextStory story, int start, int? end) → List< int> - Paragraphs touched by a canonical selection. Its trailing boundary is exclusive, so selecting up to the next paragraph does not format it.
-
setAlignment(
{required TextStory story, required int blockIndex, required ParagraphAlignment alignment}) → TextStory - Applies paragraph alignment without changing the block's structural role or flattening any inline runs.
-
setAlignmentInRange(
{required TextStory story, required int start, required int? end, required ParagraphAlignment alignment}) → TextStory -
setDirectionInRange(
{required TextStory story, required int start, required int? end, required ParagraphDirection direction}) → TextStory - Sets base direction for the paragraphs touched by the range.
-
splitBlock(
{required TextStory story, required int blockIndex, required int offset, required String newBlockId, DiagramTextDefinition text = const PlainTextDefinition(), bool typed = true}) → TextStory