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