EzPizza
EzPizza

Reputation: 1150

How do I refresh the current route when arguments change?

I'm using auto_route with some arguments as url parameters. If I push the same route as the one I'm currently on, but using different parameters, then the displayed widget is not updated.

Why not? Can I force it to update or is there a setting for auto_route to detect these changes?

Upvotes: 3

Views: 2825

Answers (1)

Albert221
Albert221

Reputation: 7072

By default auto_route treats route name as its key. You can change that behavior with the usePathAsKey argument in the *Route class:

Property Default value Definition
usePathAsKey false if true path is used as page key instead of name

source

Upvotes: 4

Related Questions