csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
442 stars 96 forks source link

Is there any way to do something similar to pushReplacement? #53

Closed JuanseChavero closed 2 years ago

JuanseChavero commented 2 years ago

In my App I need to a do a Push within the same Path multiple times, so can't use "context.go" because it doesn't go through the initState. And doing a "context.push) to the same Route it's bad for performance and for example, when there are Controllers for ListViews, it starts showing errors because the same Controller is attached to multiple views in the Stack. Couldn't find anything in the documentation about this. Thanks!

csells commented 2 years ago

Can you describe what problem you're trying to solve?

There's no routing perf problem with pushing the same route onto the navigation stack multiple times. You can see a sample of doing just that in the push example.

JuanseChavero commented 2 years ago

Can you describe what problem you're trying to solve?

There's no routing perf problem with pushing the same route onto the navigation stack multiple times. You can see a sample of doing just that in the push example.

Then I'm pretty sure it's because the way I handle states (and probably performance in general). I thougt it was pushing a new route on top of the other without completly disposing the previous one. As for the ScrollControllers problem, already fixed it by initializing it every time in the initState() rather than it being final. Thanks, amazing package by the way, really easy to use!

csells commented 2 years ago

@Ch4v3-98 I'm glad you're enjoying it! Keep those cards and letters coming!