FilledStacks / flutter-tutorials

The repo contains the source code for all the tutorials on the FilledStacks Youtube channel.
MIT License
4.75k stars 1.76k forks source link

Clear back stack #99

Closed h4h13 closed 4 years ago

h4h13 commented 4 years ago

Hi, I'm new to this Architectures pattern that you're using, I got stumbled where I have to clear the back stack just like Navigator.of(context).pushAndRemoveUntil(newRoute, (route) => false); can you help me how to do this with NavigationService class *Sorry for my English.

h4h13 commented 4 years ago

Sorry, I got it edited NavigationService with another method Future<dynamic> navigateToPush(String routeName, {dynamic arguments}) { return navigatorKey.currentState .pushNamedAndRemoveUntil(routeName, (route) => false); } Is this right?

FilledStacks commented 4 years ago

@h4h13 yes, the NavigationService has functions for this as well. The last 1 in the list.