LightTimedEffects.fromJson constructor

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

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

Implementation

factory LightTimedEffects.fromJson(Map<String, dynamic> dataMap) {
  return LightTimedEffects(
    effect: dataMap[ApiFields.effect] ?? "",
    effectValues: List<String>.from(dataMap[ApiFields.effectValues] ?? []),
    duration: dataMap[ApiFields.duration] ?? 0,
    status: dataMap[ApiFields.status] ?? "",
    statusValues: List<String>.from(dataMap[ApiFields.statusValues] ?? []),
  );
}