Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b404502

Browse files
authored
SemanticsUpdateBuilder: make all args non-null (#49148)
This PR is inspired by [the suggestion made here](#47961 (comment)).
1 parent 23d2fcd commit b404502

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

lib/ui/fixtures/ui_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ void sendSemanticsUpdate() {
173173
),
174174
];
175175

176+
String tooltip = "tooltip";
177+
176178
final Float64List transform = Float64List(16);
177179
final Int32List childrenInTraversalOrder = Int32List(0);
178180
final Int32List childrenInHitTestOrder = Int32List(0);
@@ -224,6 +226,7 @@ void sendSemanticsUpdate() {
224226
decreasedValueAttributes: decreasedValueAttributes,
225227
hint: hint,
226228
hintAttributes: hintAttributes,
229+
tooltip: tooltip,
227230
textDirection: TextDirection.ltr,
228231
transform: transform,
229232
childrenInTraversalOrder: childrenInTraversalOrder,

lib/ui/semantics.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ abstract class SemanticsUpdateBuilder {
818818
required List<StringAttribute> decreasedValueAttributes,
819819
required String hint,
820820
required List<StringAttribute> hintAttributes,
821-
String? tooltip,
822-
TextDirection? textDirection,
821+
required String tooltip,
822+
required TextDirection? textDirection,
823823
required Float64List transform,
824824
required Int32List childrenInTraversalOrder,
825825
required Int32List childrenInHitTestOrder,
@@ -888,8 +888,8 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
888888
required List<StringAttribute> decreasedValueAttributes,
889889
required String hint,
890890
required List<StringAttribute> hintAttributes,
891-
String? tooltip,
892-
TextDirection? textDirection,
891+
required String tooltip,
892+
required TextDirection? textDirection,
893893
required Float64List transform,
894894
required Int32List childrenInTraversalOrder,
895895
required Int32List childrenInHitTestOrder,
@@ -927,7 +927,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
927927
decreasedValueAttributes,
928928
hint,
929929
hintAttributes,
930-
tooltip ?? '',
930+
tooltip,
931931
textDirection != null ? textDirection.index + 1 : 0,
932932
transform,
933933
childrenInTraversalOrder,

shell/platform/embedder/fixtures/main.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Future<void> a11y_main() async {
167167
decreasedValue: '',
168168
decreasedValueAttributes: <StringAttribute>[],
169169
tooltip: 'tooltip',
170+
textDirection: TextDirection.ltr,
170171
additionalActions: Int32List(0),
171172
)
172173
..updateNode(
@@ -199,6 +200,7 @@ Future<void> a11y_main() async {
199200
decreasedValue: '',
200201
decreasedValueAttributes: <StringAttribute>[],
201202
tooltip: 'tooltip',
203+
textDirection: TextDirection.ltr,
202204
additionalActions: Int32List(0),
203205
childrenInHitTestOrder: Int32List(0),
204206
childrenInTraversalOrder: Int32List(0),
@@ -235,6 +237,7 @@ Future<void> a11y_main() async {
235237
decreasedValue: '',
236238
decreasedValueAttributes: <StringAttribute>[],
237239
tooltip: 'tooltip',
240+
textDirection: TextDirection.ltr,
238241
additionalActions: Int32List(0),
239242
)
240243
..updateNode(
@@ -268,6 +271,7 @@ Future<void> a11y_main() async {
268271
decreasedValue: '',
269272
decreasedValueAttributes: <StringAttribute>[],
270273
tooltip: 'tooltip',
274+
textDirection: TextDirection.ltr,
271275
childrenInHitTestOrder: Int32List(0),
272276
childrenInTraversalOrder: Int32List(0),
273277
)
@@ -364,6 +368,7 @@ Future<void> a11y_string_attributes() async {
364368
decreasedValue: '41',
365369
decreasedValueAttributes: <StringAttribute>[],
366370
tooltip: 'tooltip',
371+
textDirection: TextDirection.ltr,
367372
additionalActions: Int32List(0),
368373
);
369374

0 commit comments

Comments
 (0)