Skip to content

Instantly share code, notes, and snippets.

@marcinOz
Created February 17, 2019 20:43
Show Gist options
  • Save marcinOz/0edea9bbd8eabf3e6e7893a05215173c to your computer and use it in GitHub Desktop.
Save marcinOz/0edea9bbd8eabf3e6e7893a05215173c to your computer and use it in GitHub Desktop.
_navigate(Store<AppState> store, action, NextDispatcher next) {
if (action is NavigatePopAction && navigatorKey.currentState.canPop()) {
navigatorKey.currentState.pop();
} else if (action is NavigatePushAction) {
if (store.state.route.last != action.routeName) {
navigatorKey.currentState.pushNamed(action.routeName);
}
}
next(action); //This need to be after name checks
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment