Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
wangjinshan wants to merge 2 commits into singerdmx:master
base: master
Choose a base branch
Loading
from wangjinshan:master

Conversation

Copy link

@wangjinshan wangjinshan commented May 1, 2025

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

Copy link
Author

see
#2553

Copy link
Author


// 强制设置同高
final bool? forceStrutHeight;
// 基线位置
Copy link
Collaborator

@CatHood0 CatHood0 Aug 5, 2025

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

Reviewers

@CatHood0 CatHood0 CatHood0 left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /