mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Include tags in SemanticsNode debug properties (#35491)
This commit is contained in:
parent
4ca7bfa0c2
commit
d41eeeb50d
@ -2082,6 +2082,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
|
||||
}
|
||||
properties.add(DiagnosticsProperty<Rect>('rect', rect, description: description, showName: false));
|
||||
}
|
||||
properties.add(IterableProperty<String>('tags', tags?.map((SemanticsTag tag) => tag.name), defaultValue: null));
|
||||
final List<String> actions = _actions.keys.map<String>((SemanticsAction action) => describeEnum(action)).toList()..sort();
|
||||
final List<String> customSemanticsActions = _customSemanticsActions.keys
|
||||
.map<String>((CustomSemanticsAction action) => action.label)
|
||||
|
||||
@ -435,6 +435,7 @@ void main() {
|
||||
' isMergedIntoParent: false\n'
|
||||
' mergeAllDescendantsIntoThisNode: false\n'
|
||||
' Rect.fromLTRB(0.0, 0.0, 0.0, 0.0)\n'
|
||||
' tags: null\n'
|
||||
' actions: []\n'
|
||||
' customActions: []\n'
|
||||
' flags: []\n'
|
||||
@ -530,6 +531,7 @@ void main() {
|
||||
' isMergedIntoParent: false\n'
|
||||
' mergeAllDescendantsIntoThisNode: false\n'
|
||||
' Rect.fromLTRB(0.0, 0.0, 0.0, 0.0)\n'
|
||||
' tags: null\n'
|
||||
' actions: customAction\n'
|
||||
' customActions: action1, action2, action3\n'
|
||||
' flags: []\n'
|
||||
@ -551,7 +553,16 @@ void main() {
|
||||
' elevation: 0.0\n'
|
||||
' thickness: 0.0\n',
|
||||
);
|
||||
});
|
||||
|
||||
test('Tags show up in debug properties', () {
|
||||
final SemanticsNode actionNode = SemanticsNode()
|
||||
..tags = <SemanticsTag>{RenderViewport.useTwoPaneSemantics};
|
||||
|
||||
expect(
|
||||
actionNode.toStringDeep(),
|
||||
contains('\n tags: RenderViewport.twoPane\n'),
|
||||
);
|
||||
});
|
||||
|
||||
test('SemanticsConfiguration getter/setter', () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user