Skip to content

Commit a438877

Browse files
authored
SemanticsProperties: default identifier and tooltip to null (flutter#140283)
This PR applies [the suggestion made here](flutter/devtools#6942 (comment)).
1 parent b893884 commit a438877

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/flutter/lib/src/semantics/semantics.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ class SemanticsProperties extends DiagnosticableTree {
16561656
properties.add(DiagnosticsProperty<bool>('mixed', mixed, defaultValue: null));
16571657
properties.add(DiagnosticsProperty<bool>('expanded', expanded, defaultValue: null));
16581658
properties.add(DiagnosticsProperty<bool>('selected', selected, defaultValue: null));
1659-
properties.add(StringProperty('identifier', identifier));
1659+
properties.add(StringProperty('identifier', identifier, defaultValue: null));
16601660
properties.add(StringProperty('label', label, defaultValue: null));
16611661
properties.add(AttributedStringProperty('attributedLabel', attributedLabel, defaultValue: null));
16621662
properties.add(StringProperty('value', value, defaultValue: null));
@@ -1667,7 +1667,7 @@ class SemanticsProperties extends DiagnosticableTree {
16671667
properties.add(AttributedStringProperty('attributedDecreasedValue', attributedDecreasedValue, defaultValue: null));
16681668
properties.add(StringProperty('hint', hint, defaultValue: null));
16691669
properties.add(AttributedStringProperty('attributedHint', attributedHint, defaultValue: null));
1670-
properties.add(StringProperty('tooltip', tooltip));
1670+
properties.add(StringProperty('tooltip', tooltip, defaultValue: null));
16711671
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
16721672
properties.add(DiagnosticsProperty<SemanticsSortKey>('sortKey', sortKey, defaultValue: null));
16731673
properties.add(DiagnosticsProperty<SemanticsHintOverrides>('hintOverrides', hintOverrides, defaultValue: null));

packages/flutter/test/semantics/semantics_update_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@ void main() {
156156
'Semantics('
157157
'container: false, '
158158
'properties: SemanticsProperties, '
159-
'identifier: null, '// ignore: missing_whitespace_between_adjacent_strings
160159
'attributedLabel: "label" [SpellOutStringAttribute(TextRange(start: 0, end: 5))], '
161160
'attributedValue: "value" [LocaleStringAttribute(TextRange(start: 0, end: 5), en-MX)], '
162-
'attributedHint: "hint" [SpellOutStringAttribute(TextRange(start: 1, end: 2))], '
163-
'tooltip: null'// ignore: missing_whitespace_between_adjacent_strings
161+
'attributedHint: "hint" [SpellOutStringAttribute(TextRange(start: 1, end: 2))]'// ignore: missing_whitespace_between_adjacent_strings
164162
')',
165163
);
166164

0 commit comments

Comments
 (0)