metricFromString function
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;
}
}