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