DVNavigation class

Context-free navigation over the generated route targets.

go_router is an implementation detail behind this surface: application code navigates with DV.Navigation and DVPages/DVRoutes so the engine can change without breaking call sites.

Constructors

DVNavigation()
const

Properties

canGoBack → bool
Whether back would do anything.
no setter
currentPath → String
The current location, as the URL the router resolved.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isAttached → bool
Whether a router has been attached. Navigating without one throws, so widgets built outside a Dartvel app can check first.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

back<T extends Object?>([T? result]) → void
Pops the top page when there is one to pop.
Navigates to target now, replacing the current location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
push<T extends Object?>(DVRouteTarget target) → Future<T?>
Pushes target onto the navigation stack, keeping the current page.
to(DVRouteTarget target) → VoidCallback
A callback that navigates to target, for use directly in handlers: DVBox(...).onPressed(DV.Navigation.to(DVPages.users)). A callback that navigates to target when called.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

debugLoadFromServer ↔ ValueChanged<String>?
Stands in for a full page load in tests, where there is no browser.
getter/setter pair

Static Methods

attach(GoRouter router) → void
Called by the generated createDartvelRouter(). Navigation needs a handle to the live router because to is used in callbacks such as onPressed, where no BuildContext is in scope.
detach() → void
Forgets the attached router. Tests that build their own router should call this in teardown so one test cannot navigate another's.
goOrLoad(GoRouter router, String path) → void
Goes to path, a path on this origin: through the router when it serves one there, and as a page load from the server when it does not. Studio at its mount is the server's, not the router's, and asking the router for it draws the application's own not-found page.
locationOf(DVRouteTarget target) → String
The location target is at in the attached router.