Skip to content
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

fix: cursor height is inconsistent after upgrading to Flutter 3.22 #827

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

LucasXu0
Copy link
Collaborator

@LucasXu0 LucasXu0 commented Jun 19, 2024

There's a breaking change in Flutter 3.22.x

The getFullHeightForCaret didn't respect the font size anymore if it's in the sub level

                RichText(
                  key: richTextKey,
                  text: const TextSpan(
                    children: [
                      TextSpan(
                        text: 'AppFlowy ',
                        style: TextStyle(
                          inherit: true,
                          color: Color(0xff000000),
                          fontSize: 16.0,
                          decoration: TextDecoration.none,
                        ),
                      ),
                      TextSpan(
                        text: ' Editor',
                        style: TextStyle(
                          inherit: true,
                          color: Color(0xff000000),
                          fontSize: 20.0,
                          decoration: TextDecoration.none,
                        ),
                      ),
                    ],
                  ),

Flutter 3.19.0

xxxx.mp4

Flutter 3.22.0

yyyy.mp4

Now

c.mp4

workaournd:

get the maximum line height and font size from sub textspans and set them to the parent textspan

closes #819

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.79%. Comparing base (d6388a4) to head (8c448ce).

Files Patch % Lines
.../block_component/rich_text/appflowy_rich_text.dart 91.89% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   74.79%   74.79%   -0.01%     
==========================================
  Files         301      301              
  Lines       14199    14201       +2     
==========================================
+ Hits        10620    10621       +1     
- Misses       3579     3580       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LucasXu0 LucasXu0 force-pushed the cursor_height branch 2 times, most recently from 33bb0a0 to 1cfba7c Compare June 19, 2024 08:12
@LucasXu0 LucasXu0 merged commit 64c0be8 into AppFlowy-IO:main Jun 19, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Mobile caret bug with Flutter 3.22
1 participant