LightOn.fromJson constructor

LightOn.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a LightOn object from the JSON response to a GET request.

Implementation

factory LightOn.fromJson(Map<String, dynamic> dataMap) {
  return LightOn(
    isOn: dataMap[ApiFields.isOn] ?? false,
  );
}