fromInterface static method

ScopeValue? fromInterface(
  1. String scopeValueString
)

convert a String to a ScopeValue?

Implementation

static ScopeValue? fromInterface(
  String scopeValueString,
) {
  const scopeValues = ScopeValue.values;

  final scopeValueIndex = scopeValues
      .indexWhere((scopeValue) => scopeValue.name == scopeValueString);

  final scopeValue =
      scopeValueIndex != -1 ? scopeValues[scopeValueIndex] : null;

  return scopeValue;
}