NavigationService class
Constructors
Properties
- context → BuildContext
-
Access the global BuildContext associated with the NavigatorState.
no setter
- defaultTransition ↔ NavigationTransition
-
The transition used when a push action does not specify one.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
key
→ GlobalKey<
NavigatorState> -
The GlobalKey to access the NavigatorState.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
[Object? result]) → void - Pops the current route off the navigator.
-
popUntil<
T extends Widget> ([Object? result]) → void -
Pops all routes until the page of type
Tis visible. The page must have been pushed with push before so the route name matches the widget type. If no route of typeTis in the stack, all routes except the first one are popped. -
popUntilRoot(
[Object? result]) → void - Pops all routes until there is only one left.
-
push<
T> (Widget widget, {NavigationTransition? transition}) → Future< T?> - Pushes a new route onto the navigator.
-
pushAndRemoveUntil<
T> (Widget widget, {required Type removeUntil, NavigationTransition? transition}) → Future< T?> -
Pushes a new route while popping all routes above
removeUntil. TheremoveUntilpage must have been pushed with push before so the route name matches the widget type. If no route of typeremoveUntilis in the stack, all routes except the first one are removed. -
pushNamed<
T> (String routeName, {Object? arguments}) → Future< T?> - Pushes a named route onto the navigator.
-
pushReplacement<
T> (Widget widget, {NavigationTransition? transition}) → Future< T?> - Pushes a new route, replacing the current one.
-
pushRoot<
T> (Widget widget, {NavigationTransition? transition}) → Future< T?> - Pushes a new route while removing all others.
-
setKey(
GlobalKey< NavigatorState> key) → void - Set the GlobalKey to access the NavigatorState. Use this if you already have a GlobalKey for NavigatorState.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited