castJSON static method

dynamic castJSON(
  1. Map<String, dynamic> json
)

Implementation

static castJSON(Map<String, dynamic> json) {
  String type = json["type"];

  if (type == "Shape") {
    return Shape.fromJSON(json);
  } else if (type == "Curve") {
    return Curve.fromJSON(json);
  } else if (type == "LineCurve") {
    return LineCurve.fromJSON(json);
  } else {
    throw " type: $type Curve.castJSON is not support yet... ";
  }
}