natrium_wallet_flutter icon indicating copy to clipboard operation
natrium_wallet_flutter copied to clipboard

[Suggestion] Currency from locale not working as expected

Open marlonfrr opened this issue 4 years ago • 0 comments

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).

ern

As described above, when using an unsupported country toUpperCase() was called on null:

toupper

This was found in the lib/model/available_currency.dart file.

marlonfrr avatar May 16 '20 06:05 marlonfrr