BadgedButton.fromJson constructor

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

Implementation

factory BadgedButton.fromJson(Map<String, dynamic> json) => BadgedButton(
      badgeBackgroundColor: json.containsKey("badgeBackgroundColor")
          ? ScanbotColor(json["badgeBackgroundColor"] as String)
          : ScanbotColor("#FFFFFF"),
      badgeForegroundColor: json.containsKey("badgeForegroundColor")
          ? ScanbotColor(json["badgeForegroundColor"] as String)
          : ScanbotColor("#C8193C"),
      visible: json.containsKey("visible") ? (json["visible"] as bool) : true,
      backgroundColor: json.containsKey("backgroundColor")
          ? ScanbotColor(json["backgroundColor"] as String)
          : ScanbotColor("#0000007A"),
      foregroundColor: json.containsKey("foregroundColor")
          ? ScanbotColor(json["foregroundColor"] as String)
          : ScanbotColor("#FFFFFF"),
      activeBackgroundColor: json.containsKey("activeBackgroundColor")
          ? ScanbotColor(json["activeBackgroundColor"] as String)
          : ScanbotColor("#FFCE5C"),
      activeForegroundColor: json.containsKey("activeForegroundColor")
          ? ScanbotColor(json["activeForegroundColor"] as String)
          : ScanbotColor("#1C1B1F"),
    );