vrouter icon indicating copy to clipboard operation
vrouter copied to clipboard

Allow custom objects in VRouterData

Open CosmicPangolin opened this issue 3 years ago • 1 comments

The original Navigator API allowed passing an Object? 'arguments' into the new route. Other Nav 2.0 packages seem to support similar functionality - for instance, Beamer supports a completely custom route state. A simple Object? parameter on VRouterData would be really useful for me...while I can parse query parameters and search provider states for relevant data, it's often already available at the point of navigation. :)

CosmicPangolin avatar Jan 06 '22 22:01 CosmicPangolin

@CosmicPangolin - How does this relate to what is being proposed in PR #176? This draft PR was focused on passing a custom value to the widget builder for a nested widget, but perhaps this concept could be extended in a similar way to be more general? The PR needs some help though because with it there are GlobalKey errors for reasons I can't discern.

klondikedragon avatar Jan 07 '22 00:01 klondikedragon

Closing because this is not something I was to support.

Here are a few reasons:

  • Not type/compile safe
  • Leads to unexpected issues when using the web because your navigator (ex: Chrome) don't ever let your using pass an object.

I understand this limitation is quite an issue when working on mobile but I believe that you can easily create a type-safe wrapper when it's needed which is what I want to encourage.

lulupointu avatar Apr 28 '23 18:04 lulupointu