auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

Route from local package. Route must have either a page or a redirect destination.

Open marenovakovic opened this issue 2 years ago • 5 comments

I've separated app into packages and every package has screens/routes. I create MaterialAutoRouter and I pass routes from local modules into MaterialAutoRoute routes parameter. When I run build_runner I get error Route must have either a page or a redirect destination. Does auto_route support this and if yes how can I do it?

marenovakovic avatar Aug 22 '21 21:08 marenovakovic

@marenovakovic were you able to find a solution for this 👀

Melaninneal avatar Sep 21 '21 06:09 Melaninneal

@Melaninneal make sure you pass a widget type to your route and make sure it's imported correctly

Milad-Akarie avatar Sep 21 '21 08:09 Milad-Akarie

What Im asking specifically can I define a "router"/"sub router" in a package and add/use it as a part of a router defined in my base project?

Melaninneal avatar Sep 22 '21 02:09 Melaninneal

As far as my usecase goes I have admin and customer apps. I've separated everything into packages and screens are defined inside admin and customer packages that import everything from other modules. So I don't have route per package, routes are inside admin and customer, I generate Router for both and I import it inside lib. That's how I use it. I don't have more complex example for now.

marenovakovic avatar Sep 23 '21 09:09 marenovakovic

I have the same issue check your imports i have changed a folder name from authViews to AuthViews and vs code was confused between the old and new folder naming in imports

m66are avatar Jul 16 '22 13:07 m66are

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Sep 15 '22 08:09 github-actions[bot]