walletISOCurrencyCodeFromJson function
WalletISOCurrencyCode
walletISOCurrencyCodeFromJson(
- Object? walletISOCurrencyCode, [
- WalletISOCurrencyCode? defaultValue
Implementation
enums.WalletISOCurrencyCode walletISOCurrencyCodeFromJson(
Object? walletISOCurrencyCode, [
enums.WalletISOCurrencyCode? defaultValue,
]) {
if (walletISOCurrencyCode is String) {
return enums.$WalletISOCurrencyCodeMap.entries
.firstWhere(
(element) =>
element.value.toLowerCase() ==
walletISOCurrencyCode.toLowerCase(),
orElse: () => const MapEntry(
enums.WalletISOCurrencyCode.swaggerGeneratedUnknown, ''))
.key;
}
final parsedResult = defaultValue == null
? null
: enums.$WalletISOCurrencyCodeMap.entries
.firstWhereOrNull((element) => element.value == defaultValue)
?.key;
return parsedResult ??
defaultValue ??
enums.WalletISOCurrencyCode.swaggerGeneratedUnknown;
}