PCanvasElement2D.fromJson constructor
Implementation
factory PCanvasElement2D.fromJson(Map<String, dynamic> j) {
var className = j['className'];
switch (className) {
case 'PCanvasPanel2D':
return PCanvasPanel2D.fromJson(j);
case 'PCanvasGridPanel2D':
return PCanvasGridPanel2D.fromJson(j);
default:
throw StateError("Can't handle JSON with `className`: $className");
}
}