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... ";
  }
}