BackgroundStyle.fromJson constructor

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

Implementation

factory BackgroundStyle.fromJson(Map<String, dynamic> json) =>
    BackgroundStyle(
      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,
    );