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

Built-in layouts without so much copy-pasting #1

Open
matuella opened this issue Mar 11, 2021 · 1 comment
Open

Built-in layouts without so much copy-pasting #1

matuella opened this issue Mar 11, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@matuella
Copy link
Contributor

matuella commented Mar 11, 2021

All built-in LayoutResolvers are almost copy-pasted, they all have REALLY similar tests, documentation and the code/logic itself - but are kind-of hard to abstract due to the type-safety provided by each.

The first alternative that comes to mind is to code-gen these, but I personally don't like code-gen, but if enough evidence is shown, that it indeed improves this package quality, we could look into it.

The other alternative that comes to mind is highly coupled with the mirror features that dart could improve in the near future, but is not at the point yet (it's basically the same problem that packages like mockito, built-value and auto-router face, which is also realted to the first alternative, the code-gen solution.

I still think there might be some space for other solutions, although I'm still not sure how.

Note: maybe CommonLayout and GranularLayout should be enough for most cases (and people can still implement the LayoutResolver on their own), but I still think that this is a problem that may increase as this package's lifespan expands, like if adding new built-in resolvers, or simply adding new functionality/fixes to each of them.

@matuella matuella added enhancement New feature or request help wanted Extra attention is needed labels Mar 11, 2021
@matuella
Copy link
Contributor Author

matuella commented Aug 4, 2021

If Dart eventually address the static meta-programming issues, this can be easily solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant