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