Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing arguments with AutoRouter #102

Open
kenyons opened this issue Sep 5, 2020 · 3 comments
Open

Passing arguments with AutoRouter #102

kenyons opened this issue Sep 5, 2020 · 3 comments

Comments

@kenyons
Copy link

kenyons commented Sep 5, 2020

Can the AutoRouter still be used when arguments are passed? I see how it is done manually in router of the navigation tutorial, but using the AutoRouter, the argument is not passed to the new view. Can you update the navigation example to use the new stacked_services package?

@FilledStacks
Copy link
Owner

auto_route generates an argument class that you should use. It serialises it automatically. it's [ViewName]Arguments so if your view is called HomeView you should pass HomeViewArguments as your arguments when calling navigate. It will automatically serialise and pass that to your view

@kenyons
Copy link
Author

kenyons commented Sep 9, 2020

Thanks, I had seen the arguments class generated for the HomeView, but had to run the build a couple of times for the other to show up for some reason.

One other question. Any suggested way to architect a view that is basically a wrapper for a WebView in moving to the view/viewmodel architecture? Right now I have just added a method on the viewmodel to be passed to the WebResourceErrorCallback on the WebView. Doesn't seem to be a way to handle the HTTP request in the viewmodel and pass it to the WebView.

@FilledStacks
Copy link
Owner

@kenyons I don't think you can "pass" anything to the webview. You can listen for route changes on the webview and tell it where to navigate but other than that I don't think you can pass anything to the webview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants