Skip to main content

Migration 0.2.x to 0.3.x

0.3.0 introduced clearer API names. The old 0.2.x names remain available, so migration can be incremental.

Parser Type

Before:

final worker = StreamingMarkdownParseWorker();

After:

final parser = MarkdownStreamParser();

Parse Operations

Before:

final result = await worker.request(
op: 'set',
text: markdown,
includeNodes: true,
);

After:

final result = await parser.replace(markdown);

For appended chunks:

final result = await parser.append(chunk);

For dynamic operations:

final result = await parser.parse(
operation: MarkdownParseOperation.append,
text: chunk,
);

Renderer

Before:

StreamingMarkdownRenderView(
nodes: result.renderNodes,
);

After:

AnimatedStreamingMarkdown(
blocks: result.blocks,
);

Common Renames

0.2.x0.3.x
StreamingMarkdownParseWorkerMarkdownStreamParser
StreamingMarkdownParseResultMarkdownParseResult
StreamingMarkdownParseResult.renderNodesMarkdownParseResult.blocks
MarkdownRenderNodeMarkdownBlock
StreamingMarkdownRenderViewAnimatedStreamingMarkdown
nodesblocks
emptyPlaceholderplaceholder
sliverasSliver
allowUnclosedInlineDelimitersallowIncompleteInlineSyntax
tokenArrivalDelaytokenStaggerDelay
onTokenArrivalWaitonTokenDelay
onTokenFadeInEndonTokenAnimationEnd
tokenFadeInDurationtokenAnimationDuration
tokenFadeInRelativeToDelaytokenAnimationDurationFactor
tokenFadeInCurvetokenAnimationCurve
debugTokenHighlightshowTokenDebugColors
enableTextSelectionenableSelection
markdownThemetheme
customBlockBuilderblockBuilder

Prefer the new names for new code, documentation, and issue discussions.