parseSvgPath function

Path parseSvgPath(
  1. String data
)

Parses an SVG path data string into a Path.

Results are memoized: repeated calls with the same data (e.g. drawing the same glyph every frame) return the cached Path instead of re-tokenizing the string.

Implementation

Path parseSvgPath(String data) {
  final cached = _svgPathCache[data];
  if (cached != null) return cached;
  final path = _parseSvgPathUncached(data);
  _svgPathCache[data] = path;
  return path;
}