DVNavLink.external constructor
const
DVNavLink.external(})
A link that leaves the site.
Everything a route link is — a real anchor a crawler follows and a screen reader announces, keyboard focus, Enter — pointed at another address. Without it there was no way to write a link to GitHub or pub.dev, and the obvious workaround is styled text that does nothing: it looks exactly like a working link and is dead.
It opens rather than routes. The router has no route for another origin, and the web interceptor already leaves other origins to the browser, so this and that agree by construction.
It does not preload or preview. Both render the destination, and there is no destination widget for somebody else's site.
Implementation
const DVNavLink.external(
String url, {
super.key,
required this.child,
this.openInNewTab,
this.padding = const EdgeInsets.symmetric(horizontal: 4, vertical: 6),
this.enabled = true,
this.semanticLabel,
this.focusNode,
this.autofocus = false,
}) : externalUrl = url,
to = const DVRouteTarget('/'),
preload = DVLinkPreload.none,
preview = DVLinkPreview.none,
onPreload = null,
onPreview = null;