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