PermanentViewFinderConfiguration.fromJson constructor

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

Implementation

factory PermanentViewFinderConfiguration.fromJson(
        Map<String, dynamic> json) =>
    PermanentViewFinderConfiguration(
      style: json.containsKey("style")
          ? FinderStyle.fromJson(json["style"] as Map<String, dynamic>)
          : FinderCorneredStyle(
              strokeColor: ScanbotColor("?sbColorSurface"),
              strokeWidth: 2.0,
              cornerRadius: 10.0),
      overlayColor: json.containsKey("overlayColor")
          ? ScanbotColor(json["overlayColor"] as String)
          : ScanbotColor("?sbColorSurfaceLow"),
      aspectRatio: json.containsKey("aspectRatio")
          ? AspectRatio.fromJson(json["aspectRatio"] as Map<String, dynamic>)
          : AspectRatio(width: 1.0, height: 1.0),
      minimumInsets: json.containsKey("minimumInsets")
          ? EdgeInsets.fromJson(json["minimumInsets"] as Map<String, dynamic>)
          : EdgeInsets(top: 16.0, left: 16.0, bottom: 16.0, right: 16.0),
      preferredHeight: json.containsKey("preferredHeight")
          ? (json["preferredHeight"] as num).toDouble()
          : -1.0,
    );