TitleTag.from constructor

TitleTag.from(
  1. String value
)

Builds a TitleTag from value

Implementation

factory TitleTag.from(String value) {
  try {
    TitleTagEnum tag = TitleTagEnum.fromValue(value);
    return TitleTag(tag);
  } catch (e) {
    return TitleTag.custom(value.replaceFirst('custom:', ''));
  }
}