PolygonStyle.fromJson constructor

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

Implementation

factory PolygonStyle.fromJson(Map<String, dynamic> json) => PolygonStyle(
      strokeColor: json.containsKey("strokeColor")
          ? ScanbotColor(json["strokeColor"] as String)
          : ScanbotColor("#FFFFFFFF"),
      fillColor: json.containsKey("fillColor")
          ? ScanbotColor(json["fillColor"] as String)
          : ScanbotColor("#FFFFFF30"),
      strokeWidth: json.containsKey("strokeWidth")
          ? (json["strokeWidth"] as num).toDouble()
          : 2.0,
      cornerRadius: json.containsKey("cornerRadius")
          ? (json["cornerRadius"] as num).toDouble()
          : 0.0,
    );