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