Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a21c006

Browse files
Create containsSemantics to allow for partial matching of semantics in tests.
* Refactor _MatchesSemantics matcher to allow for conditional validation of flags using a map * The existence of a key determines whether the check should be made * The value determines what the check should be against for the given flag/action * Used new _MatchesSemantics implementation for both matchesSemantics and containsSemantics * Add assertion to SemanticsData that enforces the customSemanticsActionIds and actions are in sync * Test containsSemantics and new assertion on `SemanticsData` Fixes [#107859](#107859)
1 parent fa89238 commit a21c006

File tree

3 files changed

+864
-130
lines changed

3 files changed

+864
-130
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
23152315
);
23162316
assert(
23172317
!_canPerformAction(SemanticsAction.decrease) || (value == '') == (decreasedValue == ''),
2318-
'A SemanticsNode with action "increase" needs to be annotated with either both "value" and "decreasedValue" or neither',
2318+
'A SemanticsNode with action "decrease" needs to be annotated with either both "value" and "decreasedValue" or neither',
23192319
);
23202320
}
23212321

0 commit comments

Comments
 (0)