Skip to content

Add predicate parameters to the navigateTo method.#249

Open
chan132 wants to merge 1 commit into
lukepighetti:mainfrom
chan132:main
Open

Add predicate parameters to the navigateTo method.#249
chan132 wants to merge 1 commit into
lukepighetti:mainfrom
chan132:main

Conversation

@chan132
Copy link
Copy Markdown

@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