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

Consider swapping strings for enum #50

Closed
Ascenio opened this issue Mar 31, 2021 · 2 comments
Closed

Consider swapping strings for enum #50

Ascenio opened this issue Mar 31, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Ascenio
Copy link

Ascenio commented Mar 31, 2021

So, I think enums are just safer because we are in a typed language so makes sense to use it. You could keep strings as is and mark them as deprecated so that in near future they can be removed without breaking changes. For those who still prefer literals you could provide a Flag.fromString, but it wouldn't harm to get rid of the strings, but that's just my opinion. Would like to know what you guys think.

@Ascenio Ascenio changed the title Consider swapping strings literals for Strings Consider swapping strings for enum Mar 31, 2021
@LunaGao
Copy link
Owner

LunaGao commented Apr 3, 2021

@Ascenio That's a great idea.

@LunaGao LunaGao self-assigned this Apr 3, 2021
@LunaGao LunaGao added the enhancement New feature or request label Apr 3, 2021
@bounty1342
Copy link
Contributor

Flag.fromString would be much needed in that case.
If countryCode is the result of an API, there is no way to make sure there is a corresponding flag, making also the replacementWidget obsolete.

@LunaGao LunaGao closed this as completed in 35aedd2 Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants