BaseRouterDelegate
Base class for router delegates. The RouteDelegate defines application specific behaviors of how the router learns about changes in the application state and how it responds to them. This abstract class provides the core navigation functionality and should be extended to create custom router delegates.Properties
Global key for the Navigator widget. Persists the navigator across rebuilds.
The current list of routes in the navigation stack.
Whether the current route can be popped. Returns false if canPop was explicitly set to false, or if there are no routes in the stack.
Returns the last route in the stack, or null if the stack is empty. Helps complete the browser history and enables browser back and forward buttons.
Stream of current route changes. Listen to this stream to be notified when the current route changes.
Global data map for storing route-specific data.
List of navigation data routes. This must be set by the implementing class.
Optional page override function. If set, this function is called to build a page that overrides the normal navigation stack. Useful for loading screens.
Optional page overlay function. If set, this function is called to build a page that overlays the normal navigation stack. Useful for lock screens.
Exposes the routes history to the implementation to allow modifying the navigation stack based on app state.
Unknown route generation function.
Whether to enable debug logging for navigation operations. When enabled, navigation operations will print debug messages to help with troubleshooting.
Methods
BaseRouterDelegate implements all methods from NavigationInterface. See NavigationManager for the complete list of navigation methods including:push,pushRoutepop,popUntil,popUntilRoutepushAndRemoveUntil,pushAndRemoveUntilRouteremove,removeRoutepushReplacement,pushReplacementRouteremoveBelow,removeRouteBelowremoveAbove,removeRouteAboveremoveGroupreplace,replaceRoutereplaceBelow,replaceRouteBelowset,setRoutessetBackstack,setBackstackRoutessetOverride,removeOverridesetOverlay,removeOverlaysetQueryParametersnavigate,neglectapply,clear
DefaultRouterDelegate
Default implementation of BaseRouterDelegate. This class provides a complete router delegate implementation with support for deeplinks, custom page builders, and navigation observers.Constructor
List of navigation routes.
Whether to enable debug logging.
Handler for unknown routes.
Optional custom page builder for all routes.
Optional migration page builder for legacy route support.
List of navigation observers to attach to the Navigator.
List of deeplink destinations to handle.
Optional custom deeplink handler function. If provided, this function is called for all incoming deeplinks. Return true if the deeplink was handled, false otherwise.
Whether the user is currently authenticated. Used to determine if authenticated deeplinks can be opened.
List of route names/paths to exclude from deeplink navigation.
Optional callback for handling pop page events.
Properties
Optional custom page builder for all routes.
Optional migration page builder for legacy route support.
List of navigation observers to attach to the Navigator.
List of deeplink destinations to handle.
Optional custom deeplink handler function.
Whether the user is currently authenticated.
List of route names/paths to exclude from deeplink navigation.
Optional callback for handling pop page events.