DisplayItem.fromJson constructor
Implementation
factory DisplayItem.fromJson(Map<String, dynamic> json) {
final type = json['type'] as String;
switch (type) {
case 'GlyphPath': return GlyphPathItem.fromJson(json);
case 'Line': return LineItem.fromJson(json);
case 'Rect': return RectItem.fromJson(json);
case 'Path': return PathItem.fromJson(json);
default: throw FormatException('Unknown DisplayItem type: $type');
}
}