fromIdentifier static method

LuneViewType? fromIdentifier(
  1. String identifier
)

Returns the LuneViewType for a given identifier string

identifier The string identifier to look up

Returns the corresponding LuneViewType if found, or throws an ArgumentError if the identifier is not recognized.

Implementation

static LuneViewType? fromIdentifier(String identifier) {
  return LuneViewType.values.firstWhere(
    (type) => type.identifier == identifier,
    orElse: () => throw ArgumentError('Unknown view type: $identifier'),
  );
}