EntertainmentConfigurationLocation.fromJson constructor

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

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

Implementation

factory EntertainmentConfigurationLocation.fromJson(
    Map<String, dynamic> dataMap) {
  return EntertainmentConfigurationLocation(
    service: Relative.fromJson(
        Map<String, dynamic>.from(dataMap[ApiFields.service] ?? {})),
    position: EntertainmentConfigurationPosition.fromJson(
        Map<String, dynamic>.from(dataMap[ApiFields.position] ?? {})),
    positions: (dataMap[ApiFields.positions] as List<dynamic>?)
            ?.map((positionMap) =>
                EntertainmentConfigurationPosition.fromJson(
                    Map<String, dynamic>.from(positionMap)))
            .toList() ??
        [],
    equalizationFactor: dataMap[ApiFields.equalizationFactor] ?? 0,
  );
}