Open tomgilder opened 3 years ago
There could also be Routemaster.of(context).updateRoute((route) => route.copyWith(...))
Or adding a pushRoute
method: Routemaster.of(context).pushRoute(RouteData.of(context).copyWith(...))
or Routemaster.of(context).updateRoute(queryParameters: {'order': 'recent', 'q': query});
?
because I think push is unclear.
It would be nice if it's easier to alter the current path, such as changing one query parameter.
For instance if the user is on
/search?q=blah&order=popular
and we want to change to/products?q=blah&order=recent
, currently you have to change the entire URL:We could make
currentRoute
writeable and add acopyWith
:We could make
.push()
nullable (but I really don't like this):...or there could be an entire new method.
But it would be nice if somehow you could just update one parameter, not have to create a new map with all of them.