parsePercentage static method

double? parsePercentage(
  1. String value
)

Implementation

static double? parsePercentage(String value) {
  if (_cachedParsedPercentage.containsKey(value)) {
    return _cachedParsedPercentage[value];
  }
  double? parsed;
  if (value.endsWith(PERCENTAGE)) {
    parsed = double.tryParse(value.split(PERCENTAGE)[0])! / 100;
  }
  return _cachedParsedPercentage[value] = parsed;
}