fromString static method

Environment fromString(
  1. String value
)

从字符串映射枚举

Implementation

static Environment fromString(String value) {
  switch (value.toLowerCase()) {
    case 'test':
      return Environment.test;
    case 'dev':
    case 'debug':
    case 'testflight':
      return Environment.test;
    case 'production':
    case 'appstore':
    default:
      return Environment.production;
  }
}