castJson static method

Curve castJson(
  1. Map<String, dynamic> json
)

Implementation

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