-
Notifications
You must be signed in to change notification settings - Fork 982
Fix: Add Fields to Control Uniform Line Height for Span in flutter-quill #2555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Conversation
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
see
#2553
CatHood0
CatHood0
reviewed
Aug 5, 2025
// 强制设置同高
final bool? forceStrutHeight;
// 基线位置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, update the comments to use English language.
@CatHood0
CatHood0
changed the title
(削除) Add Fields to Control Uniform Line Height for Span in flutter-quill (削除ここまで)
(追記) Fix: Add Fields to Control Uniform Line Height for Span in flutter-quill (追記ここまで)
Aug 5, 2025
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.
This pull request introduces two additional fields to control the uniform line height for the RichText widget in the flutter-quill package. The goal is to enhance the text rendering by enabling a fixed line height using the StrutStyle properties, which can be controlled via forceStrutHeight and leadingOffset. This update ensures that the line height is consistent across multiple TextSpan widgets, providing better visual alignment when rendering text.
Modifications:
1. Added the strutStyle: A StrutStyle is created from the textSpan.style (or a default TextStyle) to apply a fixed line height.
• forceStrutHeight: Ensures the strut height is enforced, even if it would normally be overridden.
• leading: This controls the leading offset (the space between lines of text).
2. RichText Widget Update: The strutStyle is applied to the RichText widget to manage text rendering with the specified line height and spacing.
Code Changes:
in commit
Rationale:
• Control over Line Height: The primary reason for this change is to allow better control over the line height for text spans in flutter-quill. By adding these fields, we ensure that the line height is consistent and can be adjusted per use case.
• Improved Text Layout: This change makes it easier to handle cases where consistent vertical spacing is required between lines of text, especially for rich text editing use cases.
Potential Impact:
This modification is non-breaking, as it only introduces additional properties that can be customized. It ensures better control over text appearance without altering the core functionality of the RichText widget.
Suggested Reviewers:
• @flutter-quill team
• @maintainers