fromName static method

FragmentTypes fromName(
  1. String? name
)

Retrieves a FragmentTypes instance based on its name (case-insensitive).

Implementation

static FragmentTypes fromName(String? name) {
  try {
    return values
        .firstWhere((element) => element.name == name?.toLowerCase());
  } catch (e) {
    throw MessageException("unsupported fragment", details: {"type": name});
  }
}