fromMap static method

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

Construct from Map.

Implementation

static SetTdlibParameters? 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 use_test_dc = _map['use_test_dc']! as bool;
  var database_directory = _map['database_directory'] as String?;
  var files_directory = _map['files_directory'] as String?;
  var database_encryption_key = _map['database_encryption_key']! as bytes;
  var use_file_database = _map['use_file_database']! as bool;
  var use_chat_info_database = _map['use_chat_info_database']! as bool;
  var use_message_database = _map['use_message_database']! as bool;
  var use_secret_chats = _map['use_secret_chats']! as bool;
  var api_id = _map['api_id']! as int;
  var api_hash = _map['api_hash']! as String;
  var system_language_code = _map['system_language_code']! as String;
  var device_model = _map['device_model']! as String;
  var system_version = _map['system_version'] as String?;
  var application_version = _map['application_version']! as String;
  var enable_storage_optimizer = _map['enable_storage_optimizer']! as bool;
  var ignore_file_names = _map['ignore_file_names']! as bool;
  return SetTdlibParameters(
    extra: extra,
    clientId: clientId,
    use_test_dc: use_test_dc,
    database_directory: database_directory,
    files_directory: files_directory,
    database_encryption_key: database_encryption_key,
    use_file_database: use_file_database,
    use_chat_info_database: use_chat_info_database,
    use_message_database: use_message_database,
    use_secret_chats: use_secret_chats,
    api_id: api_id,
    api_hash: api_hash,
    system_language_code: system_language_code,
    device_model: device_model,
    system_version: system_version,
    application_version: application_version,
    enable_storage_optimizer: enable_storage_optimizer,
    ignore_file_names: ignore_file_names,
  );
}