inUnit method
Implementation
String inUnit(DurationTersity unit, int amount, [bool abbreviated = true]) {
switch (unit) {
case DurationTersity.week:
return week(amount, abbreviated);
case DurationTersity.day:
return day(amount, abbreviated);
case DurationTersity.hour:
return hour(amount, abbreviated);
case DurationTersity.minute:
return minute(amount, abbreviated);
case DurationTersity.second:
return second(amount, abbreviated);
case DurationTersity.millisecond:
return millisecond(amount, abbreviated);
case DurationTersity.microsecond:
return microseconds(amount, abbreviated);
default:
throw UnsupportedError('unsupported duration unit: $unit');
}
}