ViewFinderConfiguration.fromJson constructor

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

Implementation

factory ViewFinderConfiguration.fromJson(Map<String, dynamic> json) =>
    ViewFinderConfiguration(
      visible: json.containsKey("visible") ? (json["visible"] as bool) : true,
      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),
    );