Closed Zverik closed 2 years ago
Do I understand correctly that you need to transform a string from 'US' to IsoCode.US dynamically ?
Yes, Dart enums are spawnable with a String, I'll add something to the documentation so it's clearer.
in the mean time you can use Enum.values.byName(your_string)
so in this case IsoCode.values.byName('US')
I've updated the readme with an example. Feel free to reopen if that's not your issue
Since 5.0.0, instead of specifying a country ISO code as string, this library requires using the generated enum. This is fine when a country is known at compilation time, but for multi-national apps it breaks the workflow. All I know is a string. Even if it were a enum, it would be a different enum, coming from a different library.
Is there a way to use string ISO codes with this library?