DownwardAPIProjection.fromJson constructor

DownwardAPIProjection.fromJson(
  1. Map<String, dynamic> json
)

Creates a DownwardAPIProjection from JSON data.

Implementation

factory DownwardAPIProjection.fromJson(Map<String, dynamic> json) {
  final tempItemsJson = json['items'];

  final List<DownwardAPIVolumeFile>? tempItems = tempItemsJson != null
      ? List<dynamic>.from(tempItemsJson)
          .map(
            (e) => DownwardAPIVolumeFile.fromJson(
              Map<String, dynamic>.from(e),
            ),
          )
          .toList()
      : null;

  return DownwardAPIProjection(
    items: tempItems,
  );
}