Light.fromJson constructor

Light.fromJson(
  1. Map json, {
  2. int? id,
})

Implementation

factory Light.fromJson(Map json, {int? id}) {
  return serializers
      .deserializeWith(Light.serializer, json)!
      .rebuild((b) => b..id = id);
}