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";
  for(final key in json.keys){
    this[key] = json[key];
  }

  intensity = json["intensity"] ?? 1;
}