DesignElement.fromJson constructor
Implementation
factory DesignElement.fromJson(Map<String, dynamic> json) {
return DesignElement(
id: json['id'],
type: ElementType.values.firstWhere((e) => e.name == json['type']),
x: json['x'],
y: json['y'],
width: json['width'],
height: json['height'],
textWidget: json['textWidget'] != null
? TextWidget.fromJson(json['textWidget'])
: null,
imageUrl: json['imageUrl'],
);
}