-
Notifications
You must be signed in to change notification settings - Fork 6k
SemanticsUpdateBuilder.updateNode(): make TextDirection non-nullable #52421
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -818,7 +818,7 @@ abstract class SemanticsUpdateBuilder { | |
| required String hint, | ||
| required List<StringAttribute> hintAttributes, | ||
| required String tooltip, | ||
| required TextDirection? textDirection, | ||
| required TextDirection textDirection, | ||
| required Float64List transform, | ||
| required Int32List childrenInTraversalOrder, | ||
| required Int32List childrenInHitTestOrder, | ||
|
|
@@ -888,7 +888,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem | |
| required String hint, | ||
| required List<StringAttribute> hintAttributes, | ||
| required String tooltip, | ||
| required TextDirection? textDirection, | ||
| required TextDirection textDirection, | ||
| required Float64List transform, | ||
| required Int32List childrenInTraversalOrder, | ||
| required Int32List childrenInHitTestOrder, | ||
|
|
@@ -927,7 +927,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem | |
| hint, | ||
| hintAttributes, | ||
| tooltip, | ||
| textDirection != null ? textDirection.index + 1 : 0, | ||
| textDirection.index + 1, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happen to the case where textDirection used to be null? I think we want to send 0 to the native side?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the native side has to handle TextDirection being null, and it's a valid use case, then I think this PR doesn't make sense and can be closed. Wdyt?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I only took a quick glance of the code. We only enforce TextDirection to be non-null when there is and text data in the SemanticsData. I think this pr may not be the right move
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a new test should be added, so when in the future someone tries to do the same PR as this one, that test would fail.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is weird I remember we used to have a framework smoke test, but it was gone from the ci
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was disabled here #50800 |
||
| transform, | ||
| childrenInTraversalOrder, | ||
| childrenInHitTestOrder, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised this is not breaking the framework https://github.com/flutter/flutter/blob/28b81dc575da37247cb0719b17883b8db65560f6/packages/flutter/lib/src/semantics/semantics.dart#L2799
data.textDirection is nullable.
do you have another pr to migrate framework code?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't.
I am also surprised. I was suspecting that this PR will have red CI, and then I'd submit a separate framework PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like they are disabled here #50800