prefetch static method
Prefetches route data and lazy components for path across all active router instances.
Clean paths (excluding query strings and hashes) are prefetched at most once per session. Any errors during prefetching are swallowed silently to avoid interrupting execution.
Implementation
static Future<void> prefetch(String path) async {
final clean = path.split('?').first.split('#').first;
if (_prefetchedPaths.contains(clean)) return;
for (final router in _activeRouters) {
final m = router.match(clean);
if (m != null) {
await router.prefetchRoute(clean);
return;
}
}
}