parseSvgPath function Null safety

Path parseSvgPath(
  1. String source,
  2. {bool failSilently = false}
)

A wrapper to quickly parse a Svg path.

Implementation

Path parseSvgPath(String source, {bool failSilently = false}) {
  try {
    return Parser(source).parse();
  } catch (e) {
    if (!failSilently) {
      rethrow;
    } else {
      return Path();
    }
  }
}