beamToNamed method

void beamToNamed(
  1. String uri, {
  2. Object? routeState,
  3. Object? data,
  4. String? popToNamed,
  5. TransitionDelegate? transitionDelegate,
  6. bool beamBackOnPop = false,
  7. bool popBeamLocationOnPop = false,
  8. bool stacked = true,
  9. bool replaceRouteInformation = false,
})

Configures and beams to a BeamLocation that supports uri within its BeamLocation.pathPatterns.

For example

Beamer.of(context).beamToNamed(
  '/user/1/transactions?perPage=10',
  data: {'favoriteUser': true},,
);

See update for more details.

Implementation

void beamToNamed(
  String uri, {
  Object? routeState,
  Object? data,
  String? popToNamed,
  TransitionDelegate? transitionDelegate,
  bool beamBackOnPop = false,
  bool popBeamLocationOnPop = false,
  bool stacked = true,
  bool replaceRouteInformation = false,
}) {
  update(
    configuration: RouteInformation(uri: Uri.parse(uri), state: routeState),
    beamParameters: _currentBeamParameters.copyWith(
      popConfiguration: popToNamed != null
          ? RouteInformation(uri: Uri.parse(popToNamed))
          : null,
      transitionDelegate: transitionDelegate ?? this.transitionDelegate,
      beamBackOnPop: beamBackOnPop,
      popBeamLocationOnPop: popBeamLocationOnPop,
      stacked: stacked,
    ),
    data: data,
    replaceRouteInformation: replaceRouteInformation,
  );
}