captureSeoNodes function
Captures the semantic mirror of whatever is currently mounted.
The audit's other half. Everything the pure-Dart engine checks comes from the route table, which means it can only ever confirm that the table agrees with itself. This is the one check that compares the table against the thing users actually see.
Turns the controller on first: .seo() extensions read
SeoController.enabled at build time, so a tree pumped before
that is switched on carries no markers at all and every comparison
would come back empty — passing for the wrong reason.
Implementation
List<SeoNode> captureSeoNodes() {
final root = WidgetsBinding.instance.rootElement;
if (root == null) {
throw StateError(
'captureSeoNodes() found no widget tree — pump one first.',
);
}
return SeoController.instance.collectNodes(root);
}