fromJson method

  1. @override
Blob fromJson(
  1. Map<String, dynamic> json
)

Implementation

@override
Blob fromJson(Map<String, dynamic> json) {
  final type = json[objectType];

  if (type == 'blob') return Blob.fromJson(json);

  // Format legacy structure.
  return Blob.fromJson({
    objectType: 'blob',
    'size': -1,
    'mimeType': json['mimeType'],
    'ref': {
      '\$link': json['cid'],
    }
  });
}