fromString static method

Severity? fromString(
  1. String? severity
)

Converts the human readable severity string into a Severity value.

Implementation

static Severity? fromString(String? severity) => severity != null
    ? values.firstWhere(
        (value) => value._value == severity.toLowerCase(),
        orElse: () => Severity.none,
      )
    : null;