BeamGuard constructor

const BeamGuard({
  1. required List<Pattern> pathPatterns,
  2. required bool check(
    1. BuildContext context,
    2. BeamLocation<RouteInformationSerializable> location
    ),
  3. void onCheckFailed(
    1. BuildContext context,
    2. BeamLocation<RouteInformationSerializable> location
    )?,
  4. BeamLocation<RouteInformationSerializable> beamTo(
    1. BuildContext context,
    2. BeamLocation<RouteInformationSerializable>? origin,
    3. BeamLocation<RouteInformationSerializable> target
    )?,
  5. String beamToNamed(
    1. BeamLocation<RouteInformationSerializable>? origin,
    2. BeamLocation<RouteInformationSerializable> target
    )?,
  6. BeamPage? showPage,
  7. bool guardNonMatching = false,
  8. bool replaceCurrentStack = true,
})

Creates a BeamGuard with defined properties.

pathPatterns and check must not be null.

Implementation

const BeamGuard({
  required this.pathPatterns,
  required this.check,
  this.onCheckFailed,
  this.beamTo,
  this.beamToNamed,
  this.showPage,
  this.guardNonMatching = false,
  this.replaceCurrentStack = true,
});