fromJson static method

TimeSpan? fromJson(
  1. dynamic value
)

Implementation

static TimeSpan? fromJson(value) {
  if (value == null) return null;
  if (value is TimeSpan) return value;
  if (value is String) return TimeSpan.ofISOString(value);
  if (value is List<num>) return TimeSpan.ofParts(value);
  throw Exception("Invalid value for TimeSpan");
}