DFObjects.fromJson constructor

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

Implementation

DFObjects.fromJson(Map<String, dynamic> json) {
  height = double.tryParse(json['height'].toString()) ?? 0.0;
  id = json['id'];
  name = json['name'];
  rotation = double.tryParse(json['rotation'].toString()) ?? 0.0;
  type = json['type'];
  visible = json['visible'];
  width = double.tryParse(json['width'].toString()) ?? 0.0;
  x = double.tryParse(json['x'].toString()) ?? 0.0;
  y = double.tryParse(json['y'].toString()) ?? 0.0;
  if (json['properties'] != null) {
    properties = <Property>[];
    json['properties'].forEach((v) {
      properties?.add(new Property.fromJson(v));
    });
  }
}