[go: nahoru, domu]

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

Convert AndroidSemanticsAction to enum. #123312

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

bernaferrari
Copy link
Contributor
@bernaferrari bernaferrari commented Mar 23, 2023

Really small clean-up. I saw a class that could be an enum, and saw a few places still using describeEnum instead of name.

The nice thing is that because of primitive equality (since this week?), this will work better than ever.

@flutter-dashboard flutter-dashboard bot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels. labels Mar 23, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

@Hixie
Copy link
Contributor
Hixie commented Mar 23, 2023

test-exempt: code refactor with no semantic change

This is great! I love this.

Copy link
Contributor
@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member
@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

Nice! Thanks for the clean-up!

static const int _kExpandIndex = 1 << 18;
static const int _kCollapseIndex = 1 << 19;
static const int _kSetText = 1 << 21;
enum AndroidSemanticsAction {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why the use_enum lint didn't catch this one...

https://dart.dev/tools/linter-rules#use_enums

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @pq

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm. Looking. Thanks!

@@ -1390,7 +1390,7 @@ abstract class RenderBox extends RenderObject {
} else {
debugTimelineArguments = <String, String>{};
}
debugTimelineArguments!['intrinsics dimension'] = describeEnum(dimension);
debugTimelineArguments!['intrinsics dimension'] = dimension.name;
Copy link
Member

Choose a reason for hiding this comment

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

We should probably deprecate describeEnum and redirect people to the name getter (not necessary in this PR).

Copy link
Contributor Author
@bernaferrari bernaferrari Mar 23, 2023

Choose a reason for hiding this comment

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

I want to do this, but you need to approve the 4 steps conversion: flutter/engine#40571

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 23, 2023
@auto-submit auto-submit bot merged commit 100cf21 into flutter:master Mar 23, 2023
@bernaferrari bernaferrari deleted the prefer-enum branch March 23, 2023 19:59
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
tarrinneal pushed a commit to flutter/packages that referenced this pull request Mar 24, 2023
…3535)

* cbdee5251 Roll Flutter Engine from 59acb5362098 to 12c822327825 (3 revisions) (flutter/flutter#123330)

* 897e3db40 Inject the gstatic CanvasKit CDN URL by default in `flutter build web` (flutter/flutter#122772)

* 5a36bddd2 Stop serving Observatory by default (flutter/flutter#122419)

* b212e7b32 implement Iterator and Comparable instead of extending them (flutter/flutter#123282)

* af6029c8f c0fbe5a53 Roll Dart SDK from 9256fffbd5af to e8e045620234 (1 revision) (flutter/engine#40561) (flutter/flutter#123336)

* 9dec4fbd1 FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (flutter/flutter#123325)

* 4907464a6 20ab040cd Roll Skia from ce5ff5cc03ce to c42320d53714 (2 revisions) (flutter/engine#40565) (flutter/flutter#123340)

* 28d40a4d2 Roll Packages from 75491e9 to 0826798 (5 revisions) (flutter/flutter#123342)

* 674ff1573 [macOS] Add platform_channel sample/test (flutter/flutter#123141)

* 7b7af9f34 roll packages (flutter/flutter#123339)

* 31798757e replace some ._() constructors with class modifiers (flutter/flutter#122765)

* 7f41ab25c Fix (insert|move|remove)RenderObjectChild methods in base class (flutter/flutter#123276)

* fccca4937 Refactor buildOverscrollIndicator (flutter/flutter#123246)

* 11bbce1b2 6b0933e74 [web] Add `dart:js_interop` to `_embedder.yaml`. (flutter/engine#40545) (flutter/flutter#123347)

* 716d25246 Remove prefer_const_constructors ignores (flutter/flutter#123284)

* 100cf21e2 Prefer enum over class. (flutter/flutter#123312)

* 5ef9b847a Expose toggle to textfield's opacity animation. (flutter/flutter#122474)

* d79f3aab0 Roll Flutter Engine from 6b0933e74965 to bdce896fb64f (2 revisions) (flutter/flutter#123351)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…lutter#3535)

* cbdee5251 Roll Flutter Engine from 59acb5362098 to 12c822327825 (3 revisions) (flutter/flutter#123330)

* 897e3db40 Inject the gstatic CanvasKit CDN URL by default in `flutter build web` (flutter/flutter#122772)

* 5a36bddd2 Stop serving Observatory by default (flutter/flutter#122419)

* b212e7b32 implement Iterator and Comparable instead of extending them (flutter/flutter#123282)

* af6029c8f c0fbe5a53 Roll Dart SDK from 9256fffbd5af to e8e045620234 (1 revision) (flutter/engine#40561) (flutter/flutter#123336)

* 9dec4fbd1 FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (flutter/flutter#123325)

* 4907464a6 20ab040cd Roll Skia from ce5ff5cc03ce to c42320d53714 (2 revisions) (flutter/engine#40565) (flutter/flutter#123340)

* 28d40a4d2 Roll Packages from 75491e9 to 0826798 (5 revisions) (flutter/flutter#123342)

* 674ff1573 [macOS] Add platform_channel sample/test (flutter/flutter#123141)

* 7b7af9f34 roll packages (flutter/flutter#123339)

* 31798757e replace some ._() constructors with class modifiers (flutter/flutter#122765)

* 7f41ab25c Fix (insert|move|remove)RenderObjectChild methods in base class (flutter/flutter#123276)

* fccca4937 Refactor buildOverscrollIndicator (flutter/flutter#123246)

* 11bbce1b2 6b0933e74 [web] Add `dart:js_interop` to `_embedder.yaml`. (flutter/engine#40545) (flutter/flutter#123347)

* 716d25246 Remove prefer_const_constructors ignores (flutter/flutter#123284)

* 100cf21e2 Prefer enum over class. (flutter/flutter#123312)

* 5ef9b847a Expose toggle to textfield's opacity animation. (flutter/flutter#122474)

* d79f3aab0 Roll Flutter Engine from 6b0933e74965 to bdce896fb64f (2 revisions) (flutter/flutter#123351)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) autosubmit Merge PR when tree becomes green via auto submit App f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants