BaseRouterDelegate class abstract
A delegate that is used by the Router widget to build and configure a navigating widget.
This delegate is the core piece of the Router widget. It responds to push route and pop route intents from the engine and notifies the Router to rebuild. It also acts as a builder for the Router widget and builds a navigating widget, typically a Navigator, when the Router widget builds.
When the engine pushes a new route, the route information is parsed by the RouteInformationParser to produce a configuration of type RouteState.
- Inheritance
-
- Object
- Listenable
- RouterDelegate<
RouteState> - BaseRouterDelegate
- Mixed in types
Constructors
-
BaseRouterDelegate({required RouteConfig initialRoute, required List<
RouteConfig> routes, required RouteConfig onUnknownRoute, String? nestedPrefixPath, String? debugLabel}) - initialRoute-required initial RouteConfig for create Router initial page routes - List of RouteConfig all pages in your Navigator onUnknownRoute-required RouteConfig for create Router Unknown page
Properties
- currentConfiguration → RouteState
-
Called by the Router when it detects a route information may have
changed as a result of rebuild.
no setteroverride
- currentState ↔ RouteState
-
current RouteState of Router
getter/setter pair
- debugLabel → String
-
name for debug
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialRoute → RouteConfig
-
required initial RouteConfig for create Router initial page
final
-
The key used for retrieving the current navigator.
final
- nestedPrefixPath → String?
-
prefix path for Nested Navigator
final
- onUnknownRoute → RouteConfig
-
required RouteConfig for create Router Unknown page
final
-
pages
↔ List<
Page> ? -
Stack pages in this moment
getter/setter pair
-
previousState
↔ List<
RouteState> -
history states
getter/setter pair
-
routes
→ List<
RouteConfig> -
List of
RouteConfig
all pages in your Navigatorfinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
backState(
{bool removeLast = false}) → RouteState - use careful, update variable when will get Update pages and state in back
-
build(
BuildContext context) → Widget -
Called by the Router to obtain the widget tree that represents the
current state.
inherited
-
buildPage(
) → List< Page> - return List Page for render stack pages in Navigator 2.0 always return a new instance of List to build new render
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pop(
{bool removeLast = false}) → void - remove last page in stack pages removeLast-if stack have one page remove this page and build initial page
-
popRoute(
) → Future< bool> -
Called by the Router when the Router.backButtonDispatcher reports that
the operating system is requesting that the current route be popped.
inherited
-
push(
Uri uri, {Object? uriState, Object? innerState}) → void - Add new page in stack pages
-
pushNested(
Uri uri, {Object? uriState, Object? innerState}) → void - Add new page in stack pages with nestedprefix
-
refresh(
) → void - use notifyListeners
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
replace(
Uri uri, {Object? uriState, Object? innerState}) → void - remove all current stack pages and add one new page in stack
-
setInitialRoutePath(
RouteState configuration) → Future< void> -
Called by the Router at startup with the structure that the
RouteInformationParser obtained from parsing the initial route.
inherited
-
setNewRoutePath(
RouteState configuration) → Future< void> -
Called by the Router when the Router.routeInformationProvider reports that a
new route has been pushed to the application by the operating system.
override
-
setRestoredRoutePath(
RouteState configuration) → Future< void> -
Called by the Router during state restoration.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updatePage(
RouteState newState, {bool notif = true, bool addOne = false, bool fromLast = false}) → void - add new page in stack by new RouteState notif - use notifyListeners addOne - return when added one page from routes config fromLast - foreach config from last route
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → BaseRouterDelegate? - get instance routerDelegate from context