fromValue static method

MediaDesignation fromValue(
  1. String? value
)

Parse from string value, defaulting to 'other' if unknown

Implementation

static MediaDesignation fromValue(String? value) {
  if (value == null) return MediaDesignation.other;
  return MediaDesignation.values.firstWhere(
    (d) => d.value == value.toLowerCase(),
    orElse: () => MediaDesignation.other,
  );
}