ChildBackButtonDispatcher class

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.

Inheritance

Constructors

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

Properties

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

Methods

addCallback(ValueGetter<Future<bool>> callback) → void
Register the callback to be called when the object changes.
inherited
createChildBackButtonDispatcher() ChildBackButtonDispatcher
Creates a ChildBackButtonDispatcher that is a direct descendant of this back button dispatcher.
inherited
deferTo(ChildBackButtonDispatcher child) → void
Mark the given child as taking priority over this object and the other children.
override
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.
inherited
invokeCallback(Future<bool> defaultValue) Future<bool>
Handles a pop route request.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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.
override
toString() String
A string representation of this object.
inherited

Operators

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