ActiveRouteRestorable<T extends RouteUnique> class

A RestorableValue that manages the restoration of the currently active route in the navigation stack.

Role in Navigation Flow

ActiveRouteRestorable tracks the currently visible route:

  1. Saves the active route when coordinator state changes
  2. Restores navigation to the saved route during app initialization
  3. Enables seamless user experience after app restart

This class is used internally by _CoordinatorRestorableState to track the active route separately from the full navigation stack.

Relationship

The restoration data flow:

CoordinatorRestorableState
  ├─ _CoordinatorRestorable       (saves ALL routes in ALL paths)
  └─ ActiveRouteRestorable        (saves the ONE active route)
       └─ On restore → Coordinator.navigate(activeRoute)
Inheritance
Available extensions

Constructors

ActiveRouteRestorable({required T? initialRoute, required RouteUriParserSync<RouteUnique> parseRouteFromUri, required RouteLayoutParentConstructor<RouteTarget> createLayoutParent, required DecodeLayoutKeyCallback decodeLayoutKey, required RestorableConverterLookupFunction getRestorableConverter})

Properties

createLayoutParent RouteLayoutParentConstructor<RouteTarget>
final
decodeLayoutKey DecodeLayoutKeyCallback
final
enabled bool
Whether the object currently returned by toPrimitives should be included in the restoration state.
no setterinherited
getRestorableConverter RestorableConverterLookupFunction
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initialRoute → T?
The initial route to use when no restoration data is available.
final
isRegistered bool
Whether this property is currently registered with a RestorationMixin.
no setterinherited
parseRouteFromUri RouteUriParserSync<RouteUnique>
Function to parse a route from a URI string.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state State<StatefulWidget>
The State object that this property is registered with.
no setterinherited
value ↔ T?
The current value stored in this property.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
createDefaultValue() → T?
Called by the RestorationMixin if no restoration data is available to restore the value of the property from to obtain the default value for the property.
override
didUpdateValue(T? oldValue) → void
Called whenever a new value is assigned to value.
override
dispose() → void
Discards any resources used by the object.
inherited
fromPrimitives(Object? data) → T?
Called by the RestorationMixin to convert the data previously retrieved from toPrimitives back into an object of type T that this property should wrap.
override
initWithValue(T? value) → void
Called by the RestorationMixin with the value returned by either createDefaultValue or fromPrimitives to set the value that this property currently wraps.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toListenableMixin() ListenableMixin

Available on Listenable, provided by the ListenableToListenableMixin extension

Wraps this listenable as a ListenableMixin for RouteGuard.canPopListenable.
toPrimitives() Object?
Called by the RestorationMixin to retrieve the information that this property wants to store in the restoration data.
override
toString() String
A string representation of this object.
inherited

Operators

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