int parseInterval(String input)

Source

int parseInterval(String input) {
  if (input == null) {
    return 0;
  }

  /// Sanitize Input
  input = input.trim().toLowerCase().replaceAll(" ", "");

  if (input == "none") {
    return 0;
  }

  if (input == "default") {
    return 0;
  }

  if (!_intervalPattern.hasMatch(input)) {
    throw new FormatException("Bad Interval Syntax: ${input}");
  }

  var match = _intervalPattern.firstMatch(input);
  var multiplier = num.parse(match[1]);
  var typeName = match[2];
  var typeKey = _intervalTypes.keys.firstWhere((x) => x.contains(typeName));
  var type = _intervalTypes[typeKey];
  return (multiplier * type).round();
}