beamTo method

void beamTo(
  1. BeamLocation<RouteInformationSerializable> location, {
  2. Object? data,
  3. BeamLocation<RouteInformationSerializable>? popTo,
  4. TransitionDelegate? transitionDelegate,
  5. bool beamBackOnPop = false,
  6. bool popBeamLocationOnPop = false,
  7. bool stacked = true,
  8. bool replaceRouteInformation = false,
})

Beams to a specific, manually configured BeamLocation.

For example

Beamer.of(context).beamTo(
  Location2(
    BeamState(
      pathBlueprintSegments = ['user',':userId','transactions'],
      pathParameters = {'userId': '1'},
      queryParameters = {'perPage': '10'},
      data = {'favoriteUser': true},
    ),
  ),
);

See update for more details.

Implementation

void beamTo(
  BeamLocation location, {
  Object? data,
  BeamLocation? popTo,
  TransitionDelegate? transitionDelegate,
  bool beamBackOnPop = false,
  bool popBeamLocationOnPop = false,
  bool stacked = true,
  bool replaceRouteInformation = false,
}) {
  _beamLocationCandidate = location;
  update(
    configuration: location.state.routeInformation,
    beamParameters: _currentBeamParameters.copyWith(
      popConfiguration: popTo?.state.routeInformation,
      transitionDelegate: transitionDelegate ?? this.transitionDelegate,
      beamBackOnPop: beamBackOnPop,
      popBeamLocationOnPop: popBeamLocationOnPop,
      stacked: stacked,
    ),
    data: data,
    buildBeamLocation: false,
    replaceRouteInformation: replaceRouteInformation,
  );
}