natrium_wallet_flutter
natrium_wallet_flutter copied to clipboard
[Suggestion] Currency from locale not working as expected
Hello
In the code snippet shown below, there is no way to get the currency based on local given that when the locale is supported locale.countrycode
is not null, so it will not check for the currency. And in a country that is doesn’t have currency support, locale.countrycode
will be null, and when trying to check if currency.getLocale().countryCode.toUpperCase() == locale.countryCode.toUpperCase()
toUpperCase()
will throw because locale.countryCode
is null. So the work around for this is to change the condition to be: if (locale != null && locale.countryCode != null)
.
As described above, when using an unsupported country toUpperCase()
was called on null:
This was found in the lib/model/available_currency.dart file.