ObjectGroup.fromJson constructor

ObjectGroup.fromJson(
  1. Map<String, dynamic> json
)

Implementation

ObjectGroup.fromJson(Map<String, dynamic> json) {
  drawOrder = json['draworder'];
  id = json['id'];
  name = json['name'];
  if (json['objects'] != null) {
    objects = <Objects>[];
    json['objects'].forEach((v) {
      objects?.add(new Objects.fromJson(v));
    });
  }
  opacity = double.parse(json['opacity'].toString());
  type = json['type'].toString().getTypeLayer();
  visible = json['visible'];
  x = double.tryParse(json['x'].toString()) ?? 0.0;
  y = double.tryParse(json['y'].toString()) ?? 0.0;
  offsetX = double.tryParse(json['offsetx'].toString()) ?? 0.0;
  offsetY = double.tryParse(json['offsety'].toString()) ?? 0.0;
}