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)).
toString() String
A string representation of this object.
inherited

Operators

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

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.