JNavigator class abstract
Base contract for navigation services in Flutter. Allows abstracting navigation logic to enable different implementations, making it easier to swap navigation managers without affecting the app.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canPop(
BuildContext context) → bool - Checks if it's possible to pop a route.
-
clearAndPush(
BuildContext context, String path) → Future< void> - Clears the navigation stack and pushes a new route.
-
currentRoute(
BuildContext context) → String? - Returns the current route path as a string, or null if unavailable.
-
go(
BuildContext context, String path) → Future< void> -
Navigates to a route by replacing the current one.
pathis the destination route as a string. -
goNamed(
BuildContext context, String name, {Map< String, String> ? params, Object? extra}) → Future<void> - Navigates to a named route by replacing the current one. Supports optional path parameters and extra data.
-
isCurrentRoute(
BuildContext context, String path) → bool -
Checks if the current route matches the given
path. - Navigates back to the root of the navigation stack.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
BuildContext context) → void - Pops the current route off the navigation stack.
-
popUntil(
BuildContext context, bool predicate(Route)) → void -
Pops routes until the given
predicatereturns true. Useful for returning to a specific route. -
popWithResult<
T> (BuildContext context, T result) → void -
Pops the current route and returns a
resultto the previous one. -
push(
BuildContext context, String path) → Future< void> -
Pushes a new route onto the navigation stack.
pathis the route to push. -
pushDialog<
T> (BuildContext context, Widget dialog) → Future< T?> - Pushes a dialog route onto the stack and waits for a result.
-
pushNamed(
BuildContext context, String name, {Map< String, String> ? params, Object? extra}) → Future<void> - Pushes a named route onto the stack. Supports optional path parameters and extra data.
-
pushReplacementDialog<
T> (BuildContext context, Widget dialog) → Future< T?> - Replaces the current route with a dialog and waits for a result.
-
replace(
BuildContext context, String path) → Future< void> -
Replaces the current route with a new one.
pathis the new route. -
replaceAll(
BuildContext context, String path) → Future< void> -
Replaces the entire navigation stack with a new route.
pathis the new root route. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited