fromMap static method

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

Construct from Map.

Implementation

static AutoDownloadSettings? 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 is_auto_download_enabled = _map['is_auto_download_enabled']! as bool;
  var max_photo_file_size = _map['max_photo_file_size']! as int;
  var max_video_file_size = _map['max_video_file_size']! as int;
  var max_other_file_size = _map['max_other_file_size']! as int;
  var video_upload_bitrate = _map['video_upload_bitrate']! as int;
  var preload_large_videos = _map['preload_large_videos']! as bool;
  var preload_next_audio = _map['preload_next_audio']! as bool;
  var preload_stories = _map['preload_stories']! as bool;
  var use_less_data_for_calls = _map['use_less_data_for_calls']! as bool;
  return AutoDownloadSettings(
    extra: extra,
    clientId: clientId,
    is_auto_download_enabled: is_auto_download_enabled,
    max_photo_file_size: max_photo_file_size,
    max_video_file_size: max_video_file_size,
    max_other_file_size: max_other_file_size,
    video_upload_bitrate: video_upload_bitrate,
    preload_large_videos: preload_large_videos,
    preload_next_audio: preload_next_audio,
    preload_stories: preload_stories,
    use_less_data_for_calls: use_less_data_for_calls,
  );
}