TimeSpan.ofSingleField constructor

TimeSpan.ofSingleField(
  1. dynamic field,
  2. num value
)

Implementation

factory TimeSpan.ofSingleField(dynamic field, num value) {
  final unit =
      timeSpanUnitOf(field) ?? (throw Exception("Invalid time span $field"));
  return unit.toTimeSpan(value);
}