auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

Named constructors support

Open rotorgames opened this issue 3 years ago • 0 comments

Hi @Milad-Akarie. Thank you for this amazing tool. It's brilliant.

I just would like to know is there a reason why we can't use named constructors in pages? I guess that's a good approach to generate different routes for one the one page which can take different parameters in different cases.

For example: We have LoginPage with unnamed constructor. As result, we get LoginRouter to navigate to the page. Imagine, if we can create LoginPage.second constructor, then auto_route will be able to generate two routes, the default one LoginRoute and LoginRoute.second for the named constructor.

I guess that's the best approach to support different parameters for the one page.

How do you think, is that a good idea or there are reasons why we don't need to do that?

Thanks.

rotorgames avatar Oct 11 '22 03:10 rotorgames