Light.fromJSON constructor

Light.fromJSON(
  1. Map<String, dynamic> json,
  2. Map<String, dynamic> rootJSON
)

Implementation

Light.fromJSON(Map<String, dynamic> json, Map<String, dynamic> rootJSON) : super.fromJSON(json, rootJSON) {
  if (json["color"] != null) {
    color = Color(0, 0, 0).setHex(json["color"]);
  }
  intensity = json["intensity"] ?? 1;
}