GgRouterDelegate class

This RouterDelegate applies changes of the route tree to the application's URI and applies the application's URI to the route tree. Assign an instance of this delegate to a Router's or MaterialApp's routerDelegate.

MaterialApp.router(
  title: "GgRouterExample",
  routerDelegate: GgRouterDelegate(child: ...),
  routeInformationParser: GgRouteInformationParser(),
);
Inheritance
Mixed in types

Constructors

GgRouterDelegate({required Widget child, void saveState(String state)?, Future<String?> restoreState()?, String? defaultRoute, GgRouteTreeNode? root})
The constructor.

Properties

child Widget
The child containing the routes which will build the route node tree.
getter/setter pair
currentConfiguration RouteInformation
Called by the Router when it detects a route information may have changed as a result of rebuild.
no setteroverride
defaultRoute String?
The default route loaded on beginning. The default route is ignored when a root node is specified in the constructor AND the root has already a staged child.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
The navigator key needed by PopNavigatorRouterDelegateMixin.
final
restoreState ↔ (Future<String?> Function()?)
Set restoreState to make the last state of the app being restored.
getter/setter pair
root GgRouteTreeNode
Returns the root router node
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saveState ↔ (void Function(String state)?)
Set saveState to make the last state of the app automatically be safed.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
build(BuildContext context) Widget
Builds the widget tree.
override
dispose() → void
Call this function if the delegate is not needed anymore.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
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
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setInitialRoutePath(RouteInformation configuration) Future<void>
Called by the Router at startup with the structure that the RouteInformationParser obtained from parsing the initial route.
override
setNewRoutePath(RouteInformation 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(RouteInformation configuration) Future<void>
Called by the Router during state restoration.
inherited
toString() String
A string representation of this object.
inherited

Operators

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