File.fromJson constructor

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

Parses a File from TDLib JSON.

Implementation

factory File.fromJson(Map<String, dynamic> json) => File(
  id: _readInt(json['id']),
  size: _readInt(json['size']),
  expectedSize: _readInt(json['expected_size']),
  local: _readObject(json['local'], LocalFile.fromJson),
  remote: _readObject(json['remote'], RemoteFile.fromJson),
  extra: json['@extra'],
  clientId: _readClientId(json['@client_id']),
);