Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add predicate parameters to the navigateTo method. #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chan132
Copy link

@chan132 chan132 commented Sep 1, 2021

Two parameters [isPushAndRemove] and [predicate] have been added to [FluroRouter.navigateTo] so that users can customize [RoutePredicate].

e.g. Avoid opening the same page (the scenario is as follows: when multiple network requests fail, the reason is that the network disconnects and the network error page needs to be opened, but avoids repeated opening)

router.navigateTo(
  context,
  Routes.networkErrorPage,
  isPushAndRemove: true,
  predicate: (route) =>
      route.isCurrent && route.settings.name == Routes.networkErrorPage
          ? false
          : true,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant