[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

SemanticsFlag/SemanticsAction cleanup (part 1) #40571

Merged
merged 4 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add temporary API.
  • Loading branch information
bernaferrari committed Mar 30, 2023
commit ea27d9b520567a13aacf9ff38dbfa7c2c04ea998
6 changes: 6 additions & 0 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ class SemanticsAction {
_kSetTextIndex: setText,
};

/// Temporary API until [values] return a list.
List<SemanticsAction> get valuesAsList => values.values.toList(growable: false);
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this have to be a static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, lol. Doing now.

Copy link
Member

Choose a reason for hiding this comment

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

To make sure this is actually the right change, can you implement part 2 already locally and run this change against it to make sure it works? See https://github.com/flutter/flutter/wiki/Debugging-the-engine#running-a-flutter-app-with-a-local-engine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We want static. Debugging the engine is sooooo hard and obscure. I figured out just calling the class in the same package would also work.

Copy link
Member

Choose a reason for hiding this comment

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

Mark this API as deprecated so no-one starts accidentally using it during the migration outside of the use case we have for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.


@override
String toString() {
switch (index) {
Expand Down Expand Up @@ -598,6 +601,9 @@ class SemanticsFlag {
_kIsCheckStateMixedIndex: isCheckStateMixed,
};

/// Temporary API until [values] return a list.
List<SemanticsFlag> get valuesAsList => values.values.toList(growable: false);

@override
String toString() {
switch (index) {
Expand Down
6 changes: 6 additions & 0 deletions lib/web_ui/lib/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class SemanticsAction {
_kSetTextIndex: setText,
};

/// Temporary API until [values] return a list.
List<SemanticsAction> get valuesAsList => values.values.toList(growable: false);

@override
String toString() {
switch (index) {
Expand Down Expand Up @@ -221,6 +224,9 @@ class SemanticsFlag {
_kIsCheckStateMixedIndex: isCheckStateMixed,
};

/// Temporary API until [values] return a list.
List<SemanticsFlag> get valuesAsList => values.values.toList(growable: false);

@override
String toString() {
switch (index) {
Expand Down