workoutSourceNullableFromJson function

WorkoutSource? workoutSourceNullableFromJson(
  1. Object? workoutSource, [
  2. WorkoutSource? defaultValue
])

Implementation

enums.WorkoutSource? workoutSourceNullableFromJson(
  Object? workoutSource, [
  enums.WorkoutSource? defaultValue,
]) {
  if (workoutSource == null) {
    return null;
  }
  return enums.WorkoutSource.values
          .firstWhereOrNull((e) => e.value == workoutSource) ??
      defaultValue;
}