gotoSourceFormatFromValue function

RohdSourceFormat? gotoSourceFormatFromValue(
  1. String? value
)

Decode a popup-menu value produced by gotoSourceMenuValue.

Returns null when value is not a Go-to-Source entry, so callers can fall through to handling their own menu values.

Implementation

RohdSourceFormat? gotoSourceFormatFromValue(String? value) {
  if (value == null || !value.startsWith(_gotoSourceValuePrefix)) {
    return null;
  }
  final name = value.substring(_gotoSourceValuePrefix.length);
  for (final f in RohdSourceFormat.values) {
    if (f.name == name) {
      return f;
    }
  }
  return null;
}