parseTime static method

int? parseTime(
  1. String input
)

Implementation

static int? parseTime(String input) {
  if (_cachedParsedTime.containsKey(input)) {
    return _cachedParsedTime[input];
  }
  int? milliseconds;
  if (input.endsWith(MILLISECONDS)) {
    milliseconds = double.tryParse(input.split(MILLISECONDS)[0])!.toInt();
  } else if (input.endsWith(SECOND)) {
    milliseconds = (double.tryParse(input.split(SECOND)[0])! * 1000).toInt();
  }

  return _cachedParsedTime[input] = milliseconds;
}