Movatterモバイル変換


[0]ホーム

URL:


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

Add aisSystemTextScaler matcher#160120

Merged
auto-submit[bot] merged 6 commits intoflutter:masterfrom
LongCatIsLooong:isSystemTextScaler-matcher
Mar 3, 2025
Merged

Add aisSystemTextScaler matcher#160120
auto-submit[bot] merged 6 commits intoflutter:masterfrom
LongCatIsLooong:isSystemTextScaler-matcher

Conversation

@LongCatIsLooong
Copy link
Contributor

@LongCatIsLooongLongCatIsLooong commentedDec 11, 2024
edited
Loading

This is for#159999. That PR breaks registered tests so a new matcher is added for soft transition & making it slightly easier to write tests that verify nothing is shadowing the system text scaler in the widget tree.

If this approach sounds plausible & gets merged, I'm going to:

  1. remake the breaking change announcement
  2. update the migration guide with the new matcher,
  3. migrate the registered tests and markWire up the system text scaler fromPlatformDispatcher #159999 as ready for review.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel onDiscord.

@github-actionsgithub-actionsbot added a: tests"flutter test", flutter_test, or one of our tests frameworkflutter/packages/flutter repository. See also f: labels. labelsDec 11, 2024
}

@override
double scaleFontSize(double unscaledFontSize) => textScaleFactor * unscaledFontSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add a test for this?

LongCatIsLooong reacted with thumbs up emoji
///
/// If `withScaleFactor` is specified and non-null, this matcher also asserts
/// that the [TextScaler]'s' `textScaleFactor` equals `withScaleFactor`.
Matcher isSystemTextScaler({ double? withScaleFactor }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What is a non-system text scaler? Can you add something to the docs that describes the difference between a system text scaler and a non-system one?

And for my own understanding: Why should I care in my tests whether the text scaler is system or not?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A "system" one is one that directly reflects the user's preference while the developer could introduce a MediaQuery with a "non-system" scaler (with a fixed 1.0 scaling factor, for example). This is useful (I guess) to make sure the text scaler from a certain BuildContext is using the user's preference instead of using some fixed scales.

goderbauer reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wanna add that context to the doc? I think it would be useful to specify what cases would fail this check (i.e. when developers introduce their own text scaler in a widget)

LongCatIsLooong reacted with thumbs up emoji
Copy link
Member

@goderbauergoderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

///
/// If `withScaleFactor` is specified and non-null, this matcher also asserts
/// that the [TextScaler]'s' `textScaleFactor` equals `withScaleFactor`.
Matcher isSystemTextScaler({ double? withScaleFactor }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wanna add that context to the doc? I think it would be useful to specify what cases would fail this check (i.e. when developers introduce their own text scaler in a widget)

LongCatIsLooong reacted with thumbs up emoji
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visitWriting a golden file test forpackage:flutter.

Reviewers: Read theTree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@justinmc
Copy link
Contributor

@LongCatIsLooong Heads up on this old PR if you plan to return to it after break.

@LongCatIsLooongLongCatIsLooong added the autosubmitMerge PR when tree becomes green via auto submit App labelMar 3, 2025
@auto-submitauto-submitbot removed the autosubmitMerge PR when tree becomes green via auto submit App labelMar 3, 2025
@auto-submit
Copy link
Contributor

autosubmit label was removed for flutter/flutter/160120, because - The status or check suiteLinux analyze has failed. Please fix the issues identified (or deflake) before re-applying this label.

@LongCatIsLooongLongCatIsLooong added the autosubmitMerge PR when tree becomes green via auto submit App labelMar 3, 2025
@auto-submitauto-submitbot added this pull request to themerge queueMar 3, 2025
Merged via the queue intoflutter:master with commitac71188Mar 3, 2025
74 checks passed
@flutter-dashboardflutter-dashboardbot removed the autosubmitMerge PR when tree becomes green via auto submit App labelMar 3, 2025
@LongCatIsLooongLongCatIsLooong deleted the isSystemTextScaler-matcher branchMarch 3, 2025 20:36
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMar 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@goderbauergoderbauergoderbauer approved these changes

Assignees

@LongCatIsLooongLongCatIsLooong

Labels

a: tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@LongCatIsLooong@justinmc@goderbauer

Comments


[8]ページ先頭

©2009-2026 Movatter.jp