BeamerDelegate<T extends BeamState> class
A delegate that is used by the Router to build the Navigator.
This is "the beamer", the one that does the actual beaming.
- Inheritance
-
- Object
- Listenable
- RouterDelegate<
BeamState> - BeamerDelegate
- Mixed in types
Constructors
-
BeamerDelegate({required LocationBuilder locationBuilder, String initialPath = '/', void listener(BeamState, BeamLocation<
BeamState> )?, T createState(BeamState state)?, bool preferUpdate = true, bool removeDuplicateHistory = true, BeamPage? notFoundPage, BeamLocation<BeamState> ? notFoundRedirect, String? notFoundRedirectNamed, List<BeamGuard> guards = const <BeamGuard>[], TransitionDelegate transitionDelegate = const DefaultTransitionDelegate(), TransitionDelegate beamBackTransitionDelegate = const ReverseTransitionDelegate(), bool onPopPage(BuildContext context, Route route, dynamic result)?, bool setBrowserTabTitle = true, bool updateFromParent = true, bool updateParent = true})
Properties
- active ↔ bool
-
If
false
, does not report the route until next update.getter/setter pair - beamBackTransitionDelegate → TransitionDelegate
-
A transition delegate to be used by Navigator when beaming back.
final
-
beamLocationHistory
→ List<
BeamLocation< BeamState> > -
The history of
BeamLocation
s.final -
beamStateHistory
→ List<
BeamState> -
The history of beaming states.
final
- canBeamBack → bool
-
Whether it is possible to beamBack,
i.e. there is more than 1 state in beamStateHistory.
no setter
- canPopBeamLocation → bool
-
Whether it is possible to popBeamLocation,
i.e. there is more than 1 location in beamLocationHistory.
no setter
- createState ↔ (T Function(BeamState state)?)
-
How to create a state for this delegate.
getter/setter pair
-
currentBeamLocation
→ BeamLocation<
BeamState> -
A BeamLocation that is currently responsible for providing a page stack
via BeamLocation.buildPages and holds the current
BeamState
.no setter - currentConfiguration → BeamState?
-
Called by the Router when it detects a route information may have
changed as a result of rebuild.
no setteroverride
-
currentPages
→ List<
BeamPage> -
currentBeamLocation's "effective" pages, the ones that were built.
no setter
-
guards
→ List<
BeamGuard> -
Guards that will be executing
check
on currentBeamLocation candidate.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialPath → String
-
The path to replace
/
as default initial route path upon load.final -
listener
→ (void Function(BeamState, BeamLocation<
BeamState> )?) -
The listener for this, that will be called on every navigation event
and will recieve the state and currentBeamLocation.
final
- locationBuilder → LocationBuilder
-
A builder for BeamLocations.
final
-
The Navigator that belongs to this BeamerDelegate.
no setter
-
The key used for retrieving the current navigator.
no setteroverride
-
The list of observers for the Navigator.
final
- notFoundPage ↔ BeamPage?
-
Page to show when no BeamLocation supports the incoming URI.
getter/setter pair
-
notFoundRedirect
→ BeamLocation<
BeamState> ? -
BeamLocation to redirect to when no BeamLocation supports the incoming URI.
final
- notFoundRedirectNamed → String?
-
URI string to redirect to when no BeamLocation supports the incoming URI.
final
- onPopPage ↔ (bool Function(BuildContext context, Route route, dynamic result)?)
-
Callback when
pop
is requested.getter/setter pair -
parent
↔ BeamerDelegate<
BeamState> ? -
A delegate of a parent of the Beamer that has this delegate.
getter/setter pair
- preferUpdate → bool
-
Whether to prefer updating currentBeamLocation if it's of the same type
as the BeamLocation being beamed to,
instead of adding it to beamLocationHistory.
final
- removeDuplicateHistory → bool
-
Whether to remove BeamLocations from beamLocationHistory
if they are the same type as the location being beamed to.
final
-
root
→ BeamerDelegate<
BeamState> -
The top-most BeamerDelegate, a parent of all.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setBrowserTabTitle → bool
-
Whether the title attribute of BeamPage should
be used to set and update the browser tab title.
final
- state ↔ T
-
A state of this delegate. This is the
state
that goes into locationBuilder to build an appropriate BeamLocation.getter/setter pair - transitionDelegate → TransitionDelegate
-
A transition delegate to be used by Navigator.
final
- updateFromParent → bool
-
Whether to call update when parent notifies listeners.
final
- updateParent → bool
-
Whether to call update on parent when state is updated.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
beamBack(
{Map< String, dynamic> ? data}) → bool - Beams to previous state in beamStateHistory. and removes the last state from history.
-
beamTo(
BeamLocation< BeamState> location, {BeamLocation<BeamState> ? popTo, TransitionDelegate? transitionDelegate, bool beamBackOnPop = false, bool popBeamLocationOnPop = false, bool stacked = true, bool replaceCurrent = false}) → void - Beams to a specific, manually configured BeamLocation.
-
beamToNamed(
String uri, {Map< String, dynamic> ? data, String? popToNamed, TransitionDelegate? transitionDelegate, bool beamBackOnPop = false, bool popBeamLocationOnPop = false, bool stacked = true, bool replaceCurrent = false}) → void -
Beams to BeamLocation that has
uri
contained within itsBeamLocation.pathBlueprintSegments
. -
build(
BuildContext context) → Widget -
Called by the Router to obtain the widget tree that represents the
current state.
override
-
clearBeamLocationHistory(
) → void - Remove everything except last from beamLocationHistory.
-
clearBeamStateHistory(
) → void - Remove everything except last from beamStateHistory.
-
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).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
popBeamLocation(
) → bool - Beams to previous location in beamLocationHistory and removes the last location from history.
-
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
-
popToNamed(
String uri, {Map< String, dynamic> ? data, String? popToNamed, bool beamBackOnPop = false, bool popBeamLocationOnPop = false, bool stacked = true, bool replaceCurrent = false}) → void - Calls beamToNamed with a ReverseTransitionDelegate.
-
removeLastBeamState(
) → BeamState? -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setInitialRoutePath(
BeamState beamState) → SynchronousFuture< void> -
Called by the Router at startup with the structure that the
RouteInformationParser obtained from parsing the initial route.
override
-
setNewRoutePath(
BeamState beamState) → SynchronousFuture< 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(
BeamState configuration) → Future< void> -
Called by the Router during state restoration.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{T? state, T? popState, TransitionDelegate? transitionDelegate, bool beamBackOnPop = false, bool popBeamLocationOnPop = false, bool stacked = true, bool replaceCurrent = false, bool buildBeamLocation = true, bool rebuild = true, bool updateParent = true}) → void -
Main method to update the
state
of this;Beamer.of(context)
, -
updateRouteInformation(
BeamState state) → void -
Pass this call to root which notifies the platform for a
state
change.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited