beamToReplacement method

void beamToReplacement(
  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,
})

The same as beamTo, but replaces the last state in history, i.e. removes it from the beamingHistory.last.history and then does beamTo.

Implementation

void beamToReplacement(
  BeamLocation location, {
  Object? data,
  BeamLocation? popTo,
  TransitionDelegate? transitionDelegate,
  bool beamBackOnPop = false,
  bool popBeamLocationOnPop = false,
  bool stacked = true,
}) {
  removeLastHistoryElement();
  beamTo(
    location,
    data: data,
    popTo: popTo,
    transitionDelegate: transitionDelegate,
    beamBackOnPop: beamBackOnPop,
    popBeamLocationOnPop: popBeamLocationOnPop,
    stacked: stacked,
    replaceRouteInformation: true,
  );
}