Conversation
st0ck
marked this pull request as ready for review
September 6, 2026 16:38
Allow tall inline widgets to opt out of forced strut height
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and proposal
Related to #65. A single inherited Directionality cannot give English and RTL prose paragraphs independent base directions. This draft adds optional
paragraphDirectionBuilder: TextDirection? Function(InlineSpan)to Markdown/MarkdownBody and the builder. It receives the renderer's assembled spans; a non-null result supplies Directionality around the existing paragraph widgets. Null/omitted keeps the existing tree and behavior. No automatic language detection, new dependency or renderer framework.The hook covers ordinary prose and tight/loose list/blockquote paragraphs, in selectable and non-selectable modes. Formatting and link recognizers remain attached to the same rendered spans. Images/custom widgets are not inspected or rebuilt; their surrounding text segments share paragraph direction. Headings, fenced code, table cells and list markers are excluded. README documents the application-supplied direction policy.
Related work: #147 exposes a general block-widget wrapper for anchors. This proposal is narrower and provides assembled span input rather than AST text or widget-tree inspection. Happy to align the API shape with that work; this draft does not duplicate its wrapper or change its branch. This supplies an opt-in building block for #65, not a claim to implement all automatic RTL behavior.
Callback updates
Changing paragraphDirectionBuilder on an existing Markdown/MarkdownBody triggers the existing reparse path. The callback participates in didUpdateWidget's current invalidation condition; no new cache or key workaround.
Local validation
Test SDK: Flutter 3.41.9 / Dart 3.11.5. Fresh upstream's dev-only mockito ^5.7.0 cannot resolve against that SDK's pinned meta1.17.0, so local tests used an uncommitted pubspec_overrides.yaml with mockito5.6.4. No override, lockfile, SDK or dependency changes are included in this PR. No full CI claim.