BeamLocation<T extends RouteInformationSerializable> class abstract

Configuration for a navigatable application region.

Responsible for

  • knowing which URIs it can handle: pathPatterns
  • knowing how to build a stack of pages: buildPages
  • keeping a state that provides the link between the first 2

Extend this class to define your locations to which you can then beam to.

Inheritance
Implementers

Constructors

BeamLocation([RouteInformation? routeInformation, BeamParameters? beamParameters])
Creates a BeamLocation with specified properties.

Properties

beamParameters BeamParameters
Beam parameters used to beam to the current state.
no setter
data Object?
An arbitrary data to be stored in this. This will persist while navigating within this BeamLocation.
getter/setter pair
guards List<BeamGuard>
Guards that will be executing BeamGuard.check when this gets beamed to.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
history List<HistoryElement>
The history of beaming for this.
getter/setter pair
isCurrent bool
Whether this BeamLocation is currently in use by BeamerDelegate.
no setter
mounted bool
Whether buildInit was called.
no setter
pathPatterns List<Pattern>
Represents the "form" of URI paths supported by this BeamLocation.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ T
A state of this BeamLocation.
getter/setter pair
strictPathPatterns bool
Whether pathPatterns are strictly matched agains incoming URI.
no setter
transitionDelegate TransitionDelegate?
A transition delegate to be used by Navigator.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addToHistory(RouteInformation routeInformation, [BeamParameters beamParameters = const BeamParameters(), bool tryPopping = true]) → void
Adds another HistoryElement to history list. The history element is created from given state and beamParameters.
builder(BuildContext context, Widget navigator) Widget
Gives the ability to wrap the navigator.
buildInit(BuildContext context) → void
Initialize custom bindings for this BeamLocation using BuildContext. Similar to builder, but is not tied to Widget tree.
buildPages(BuildContext context, T state) List<BeamPage>
Creates and returns the list of pages to be built by the Navigator when this BeamLocation is beamed to or internally inferred.
canHandle(Uri uri) bool
Can this handle the uri based on its pathPatterns.
create([RouteInformation? routeInformation, BeamParameters? beamParameters, bool tryPoppingHistory = true]) → void
Creates the state and adds the routeInformation to history. This is called only once during the lifetime of BeamLocation.
createState(RouteInformation routeInformation) → T
How to create state from RouteInformation given by BeamerDelegate and passed via BeamerDelegate.locationBuilder.
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
disposeState() → void
How to release any resources used by state.
initState() → void
What to do on state initialization.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onUpdate() → void
Called after initState and on each update, i.e. whenever we navigate with this BeamLocation.
removeFirstFromHistory() HistoryElement?
Removes the last HistoryElement from history and returns it.
removeLastFromHistory() HistoryElement?
Removes the last HistoryElement from history and returns it.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited
update([T copy(T)?, RouteInformation? routeInformation, BeamParameters? beamParameters, bool rebuild = true, bool tryPoppingHistory = true]) → void
Updates the state and history, depending on inputs.
updateState(RouteInformation routeInformation) → void
Updates the state upon receiving new RouteInformation, which usually happens after BeamerDelegate.setNewRoutePath.

Operators

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