Skip to content

Commit

Permalink
SemanticsUpdateBuilder: make all args non-null (flutter#49148)
Browse files Browse the repository at this point in the history
This PR is inspired by [the suggestion made here](flutter#47961 (comment)).
  • Loading branch information
bartekpacia authored Dec 20, 2023
1 parent 23d2fcd commit b404502
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/ui/fixtures/ui_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ void sendSemanticsUpdate() {
),
];

String tooltip = "tooltip";

final Float64List transform = Float64List(16);
final Int32List childrenInTraversalOrder = Int32List(0);
final Int32List childrenInHitTestOrder = Int32List(0);
Expand Down Expand Up @@ -224,6 +226,7 @@ void sendSemanticsUpdate() {
decreasedValueAttributes: decreasedValueAttributes,
hint: hint,
hintAttributes: hintAttributes,
tooltip: tooltip,
textDirection: TextDirection.ltr,
transform: transform,
childrenInTraversalOrder: childrenInTraversalOrder,
Expand Down
10 changes: 5 additions & 5 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,8 @@ abstract class SemanticsUpdateBuilder {
required List<StringAttribute> decreasedValueAttributes,
required String hint,
required List<StringAttribute> hintAttributes,
String? tooltip,
TextDirection? textDirection,
required String tooltip,
required TextDirection? textDirection,
required Float64List transform,
required Int32List childrenInTraversalOrder,
required Int32List childrenInHitTestOrder,
Expand Down Expand Up @@ -888,8 +888,8 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
required List<StringAttribute> decreasedValueAttributes,
required String hint,
required List<StringAttribute> hintAttributes,
String? tooltip,
TextDirection? textDirection,
required String tooltip,
required TextDirection? textDirection,
required Float64List transform,
required Int32List childrenInTraversalOrder,
required Int32List childrenInHitTestOrder,
Expand Down Expand Up @@ -927,7 +927,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
decreasedValueAttributes,
hint,
hintAttributes,
tooltip ?? '',
tooltip,
textDirection != null ? textDirection.index + 1 : 0,
transform,
childrenInTraversalOrder,
Expand Down
5 changes: 5 additions & 0 deletions shell/platform/embedder/fixtures/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Future<void> a11y_main() async {
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: 'tooltip',
textDirection: TextDirection.ltr,
additionalActions: Int32List(0),
)
..updateNode(
Expand Down Expand Up @@ -199,6 +200,7 @@ Future<void> a11y_main() async {
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: 'tooltip',
textDirection: TextDirection.ltr,
additionalActions: Int32List(0),
childrenInHitTestOrder: Int32List(0),
childrenInTraversalOrder: Int32List(0),
Expand Down Expand Up @@ -235,6 +237,7 @@ Future<void> a11y_main() async {
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: 'tooltip',
textDirection: TextDirection.ltr,
additionalActions: Int32List(0),
)
..updateNode(
Expand Down Expand Up @@ -268,6 +271,7 @@ Future<void> a11y_main() async {
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: 'tooltip',
textDirection: TextDirection.ltr,
childrenInHitTestOrder: Int32List(0),
childrenInTraversalOrder: Int32List(0),
)
Expand Down Expand Up @@ -364,6 +368,7 @@ Future<void> a11y_string_attributes() async {
decreasedValue: '41',
decreasedValueAttributes: <StringAttribute>[],
tooltip: 'tooltip',
textDirection: TextDirection.ltr,
additionalActions: Int32List(0),
);

Expand Down

0 comments on commit b404502

Please sign in to comment.