ElementCapture.fromJson constructor

ElementCapture.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory ElementCapture.fromJson(Map<String, Object?> json) {
  final bounds = (json['bounds'] as Map).cast<String, Object?>();
  return ElementCapture(
    elementId: json['elementId'] as String,
    file: json['file'] as String,
    x: (bounds['x'] as num).toDouble(),
    y: (bounds['y'] as num).toDouble(),
    width: (bounds['width'] as num).toDouble(),
    height: (bounds['height'] as num).toDouble(),
  );
}