powerSourceDTOListFromJson function

List<PowerSourceDTO> powerSourceDTOListFromJson(
  1. List? powerSourceDTO, [
  2. List<PowerSourceDTO>? defaultValue
])

Implementation

List<enums.PowerSourceDTO> powerSourceDTOListFromJson(
  List? powerSourceDTO, [
  List<enums.PowerSourceDTO>? defaultValue,
]) {
  if (powerSourceDTO == null) {
    return defaultValue ?? [];
  }

  return powerSourceDTO
      .map((e) => powerSourceDTOFromJson(e.toString()))
      .toList();
}