ChildBackButtonDispatcher class Null safety

A variant of BackButtonDispatcher which listens to notifications from a parent back button dispatcher, and can take priority from its parent for the handling of such notifications.

Useful when Routers are being nested within each other.

Use Router.of to obtain a reference to the nearest ancestor Router, from which the Router.backButtonDispatcher can be found, and then used as the parent of the ChildBackButtonDispatcher.



ChildBackButtonDispatcher(BackButtonDispatcher parent)
Creates a back button dispatcher that acts as the child of another.


hasCallbacks bool
Whether a callback is currently registered.
read-only, inherited
hashCode int
The hash code for this object.
read-only, inherited
parent BackButtonDispatcher
The back button dispatcher that this object will attempt to take priority over when takePriority is called.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


addCallback(ValueGetter<Future<bool>> callback) → void
Register the callback to be called when the object changes.
createChildBackButtonDispatcher() ChildBackButtonDispatcher
Creates a ChildBackButtonDispatcher that is a direct descendant of this back button dispatcher.
deferTo(ChildBackButtonDispatcher child) → void
Mark the given child as taking priority over this object and the other children.
forget(ChildBackButtonDispatcher child) → void
Causes the given child to be removed from the list of children to which this object might defer, as if deferTo had never been called for that child.
invokeCallback(Future<bool> defaultValue) Future<bool>
Handles a pop route request.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
notifiedByParent(Future<bool> defaultValue) Future<bool>
The parent of this child back button dispatcher decide to let this child to handle the invoke the callback request in BackButtonDispatcher.invokeCallback.
removeCallback(ValueGetter<Future<bool>> callback) → void
Remove a previously registered callback.
takePriority() → void
Make this BackButtonDispatcher take priority among its peers.
toString() String
A string representation of this object.


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