Photo.fromJson constructor

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

Creates a new instance from a JSON map.

Implementation

factory Photo.fromJson(Map<String, dynamic> json) {
  return Photo(
    images: (json['images'] as List)
        .map((item) =>
            PhotoImage.fromJson(Map<String, dynamic>.from(item as Map)))
        .toList(),
    duration: (json['duration'] as num).toDouble(),
  );
}