fromName static method

ProxyState fromName(
  1. String name
)

解析显示名到对应状态;未知值兜底为无错误信息的 stopped

Implementation

static ProxyState fromName(String name) => switch (name) {
  ProxyStopped._stateName => const ProxyStopped(),
  ProxyStarting._stateName => const ProxyStarting(),
  ProxyStarted._stateName => const ProxyStarted(),
  ProxyStopping._stateName => const ProxyStopping(),
  _ => const ProxyStopped(),
};