semanticNodes method
Implementation
Iterable<DebugCaptureSemanticNode> semanticNodes({
String? role,
String? label,
Object? value,
bool? focused,
bool? selected,
String? action,
Map<String, Object?> stateContains = const <String, Object?>{},
}) sync* {
final semantics = _jsonMap(_json['semantics']);
final root = _jsonMap(semantics['root']);
if (root.isEmpty) return;
final stack = <Map<String, Object?>>[root];
while (stack.isNotEmpty) {
final node = DebugCaptureSemanticNode._(stack.removeLast());
if (node._matches(
role: role,
label: label,
value: value,
focused: focused,
selected: selected,
action: action,
stateContains: stateContains,
)) {
yield node;
}
final children = node._children;
for (var i = children.length - 1; i >= 0; i--) {
stack.add(children[i]);
}
}
}