fromString static method

MetricValueLevel? fromString(
  1. String? level
)

Converts the human readable level string into a MetricValueLevel value.

Implementation

static MetricValueLevel? fromString(String? level) => level != null
    ? values.firstWhere(
        (val) => val._name == level.toLowerCase(),
        orElse: () => MetricValueLevel.none,
      )
    : null;