fromJson static method

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

Implementation

static File? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return File(
    id: (json['id'] as int?) ?? 0,
    size: (json['size'] as int?) ?? 0,
    expectedSize: (json['expected_size'] as int?) ?? 0,
    local: LocalFile.fromJson(json['local'] as Map<String, dynamic>?)!,
    remote: RemoteFile.fromJson(json['remote'] as Map<String, dynamic>?)!,
  );
}