LightAlert.fromJson constructor

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

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

Implementation

factory LightAlert.fromJson(Map<String, dynamic> dataMap) {
  return LightAlert(
    actionValues: List<String>.from(dataMap[ApiFields.actionValues] ?? {}),
    action: dataMap[ApiFields.action],
  );
}