tryParse static method

Environment tryParse(
  1. String val
)

Implementation

static Environment tryParse(String val) {
  switch (val) {
    case 'ldb':
      return Environment.ldb;
    case 'reset':
      return Environment.reset;
    case 'celerity':
      return Environment.celerity;
    case 'normal':
      return Environment.normal;
    default:
      print('$val is not a valid Environment');
      return Environment.unknown;
  }
}