titleFor method

String titleFor(
  1. String value
)

Display label for value — the aligned enumNames entry when titled, otherwise the raw value.

Implementation

String titleFor(String value) {
  final n = names;
  if (n == null) return value;
  final i = values.indexOf(value);
  return (i >= 0 && i < n.length) ? n[i] : value;
}