decodePath method Null safety

GraphicsCommandDecode decodePath(
  1. String path,
  2. [PathEncoding pathEncoding = PathEncoding.SVG]
)

Implementation

GraphicsCommandDecode decodePath(String path,
    [PathEncoding pathEncoding = PathEncoding.SVG]) {
  GraphicsCommandDecode command;
  if (pathEncoding == PathEncoding.EaselJS) {
    command = GraphicsCommandDecodeEaselJS(path);
  } else if (pathEncoding == PathEncoding.SVG) {
    command = GraphicsCommandDecodeSVG(path);
  } else {
    throw ArgumentError('Unknown path encoding.');
  }
  addCommand(command);
  return command;
}