fromString static method

SmartRateAccuracy? fromString(
  1. String? value
)

Get the SmartRateAccuracy from a String.

Implementation

static SmartRateAccuracy? fromString(String? value) {
  if (value == null) return null;
  value = value.trim().toLowerCase();
  switch (value) {
    case 'percentile_50':
    case '50th':
    case '50':
      return percentile50;
    case 'percentile_75':
    case '75th':
    case '75':
      return percentile75;
    case 'percentile_85':
    case '85th':
    case '85':
      return percentile85;
    case 'percentile_90':
    case '90th':
    case '90':
      return percentile90;
    case 'percentile_95':
    case '95th':
    case '95':
      return percentile95;
    case 'percentile_97':
    case '97th':
    case '97':
      return percentile97;
    case 'percentile_99':
    case '99th':
    case '99':
      return percentile99;
    default:
      return null;
  }
}