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