metricFromString function

TimeMetric metricFromString(
  1. String metricString
)

Implementation

TimeMetric metricFromString(String metricString) {
  switch (metricString) {
    case 'minutes':
      return TimeMetric.MINUTES;
    case 'hours':
      return TimeMetric.HOURS;
    case 'days':
      return TimeMetric.DAYS;
    case 'weeks':
      return TimeMetric.WEEKS;
    default:
      return TimeMetric.HOURS;
  }
}