fromMap static method

PhotoSize? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static PhotoSize? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var type = _map['type']! as String;
  var photo = File.fromMap(_map['photo'])!;
  var width = _map['width']! as int;
  var height = _map['height']! as int;
  var progressive_sizes = List<int>.from(
    (_map["progressive_sizes"] ?? []).map(
      (e) => e as int,
    ),
  );
  return PhotoSize(
    extra: extra,
    clientId: clientId,
    type: type,
    photo: photo,
    width: width,
    height: height,
    progressive_sizes: progressive_sizes,
  );
}