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){
  type = "Light";
  if (json["color"] != null) {
    color = Color.fromHex32(json["color"]);
  }
  intensity = json["intensity"] ?? 1;
}