Picture.fromMap constructor

Picture.fromMap(
  1. Map<String, dynamic> map
)

It creates a new instance of the Picture class from a map.

Args: map (Map<String, dynamic>): The map of data that we're going to use to create the Picture object.

Implementation

factory Picture.fromMap(Map<String, dynamic> map) {
  return Picture(
    large: map['large'] != null ? map['large'] as String : null,
    medium: map['medium'] != null ? map['medium'] as String : null,
    thumbnail: map['thumbnail'] != null ? map['thumbnail'] as String : null,
  );
}