ShapeGeometry.fromJSON constructor

ShapeGeometry.fromJSON(
  1. Map<String, dynamic> json,
  2. Map<String, dynamic> rootJSON
)

Implementation

ShapeGeometry.fromJSON(
  Map<String, dynamic> json,
  Map<String, dynamic> rootJSON,
) : super.fromJSON(json, rootJSON) {
  curveSegments = json["curveSegments"];
  type = 'ShapeGeometry';

  Shape? shapes;

  if (json["shapes"] != null) {
    List<Shape> rootShapes = rootJSON["shapes"];

    String shapeUuid = json["shapes"];
    shapes = rootShapes.firstWhere((element) => element.uuid == shapeUuid);
  }

  this.shapes = shapes != null ? [shapes] : [];

  init();
}