NavigatorState class
The mutable state for a Navigator widget.
Constructors
Properties
- context → BuildContext
-
The BuildContext for this state object.
no setterinherited
- currentRoute → Route?
-
The current (top-most) route, or null if the history is empty.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
history
→ List<
Route> -
An unmodifiable view of the route history.
no setter
- mounted → bool
-
Whether this state object is currently in the tree.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget → Navigator
-
The current widget configuration.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this state.
override
-
didUpdateWidget(
Navigator oldWidget) → void -
Called when the widget configuration changes.
inherited
-
dispose(
) → void -
Called when this state object is removed from the tree permanently.
override
-
initState(
) → void -
Called when this state object is first inserted into the tree.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
[Object? result]) → bool - Pops the top route off the navigator stack.
-
popUntil(
RoutePredicate predicate, [Object? result]) → void -
Calls pop repeatedly until
predicatereturns true for the current route. -
push<
T> (Route route) → Future< T?> -
Pushes the given
routeonto the navigator stack. -
pushNamed<
T> (String routeName, {Object? arguments}) → Future< T?> -
Pushes a named route onto the navigator stack using the configured
routesmap. -
pushReplacement<
T> (Route route, [Object? result]) → Future< T?> -
Replaces the top route with the given
route, then pushes it. -
pushReplacementNamed<
T> (String routeName, {Object? arguments, Object? result}) → Future< T?> - Replaces the current route with a named route.
-
setState(
void fn()) → void -
Notifies the framework that the internal state has changed, triggering a rebuild.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited